From ca276ef47a3b5a2ace0372f8cb87789811b1ca62 Mon Sep 17 00:00:00 2001 From: Jaremy Creechley Date: Thu, 1 Feb 2024 20:13:32 +0200 Subject: [PATCH] init --- .gitignore | 1 + apatheia.nimble | 12 ++++++++++++ src/apatheia.nim | 7 +++++++ src/apatheia/submodule.nim | 12 ++++++++++++ tests/config.nims | 1 + tests/test1.nim | 12 ++++++++++++ 6 files changed, 45 insertions(+) create mode 100644 .gitignore create mode 100644 apatheia.nimble create mode 100644 src/apatheia.nim create mode 100644 src/apatheia/submodule.nim create mode 100644 tests/config.nims create mode 100644 tests/test1.nim diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f494b1b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.tool-versions diff --git a/apatheia.nimble b/apatheia.nimble new file mode 100644 index 0000000..a06a038 --- /dev/null +++ b/apatheia.nimble @@ -0,0 +1,12 @@ +# Package + +version = "0.1.0" +author = "Jaremy Creechley" +description = "Async support for threading primitives" +license = "MIT" +srcDir = "src" + + +# Dependencies + +requires "nim >= 1.6.18" diff --git a/src/apatheia.nim b/src/apatheia.nim new file mode 100644 index 0000000..b7a2480 --- /dev/null +++ b/src/apatheia.nim @@ -0,0 +1,7 @@ +# This is just an example to get you started. A typical library package +# exports the main API in this file. Note that you cannot rename this file +# but you can remove it if you wish. + +proc add*(x, y: int): int = + ## Adds two numbers together. + return x + y diff --git a/src/apatheia/submodule.nim b/src/apatheia/submodule.nim new file mode 100644 index 0000000..8fe0894 --- /dev/null +++ b/src/apatheia/submodule.nim @@ -0,0 +1,12 @@ +# This is just an example to get you started. Users of your library will +# import this file by writing ``import apatheia/submodule``. Feel free to rename or +# remove this file altogether. You may create additional modules alongside +# this file as required. + +type + Submodule* = object + name*: string + +proc initSubmodule*(): Submodule = + ## Initialises a new ``Submodule`` object. + Submodule(name: "Anonymous") diff --git a/tests/config.nims b/tests/config.nims new file mode 100644 index 0000000..3bb69f8 --- /dev/null +++ b/tests/config.nims @@ -0,0 +1 @@ +switch("path", "$projectDir/../src") \ No newline at end of file diff --git a/tests/test1.nim b/tests/test1.nim new file mode 100644 index 0000000..dbac806 --- /dev/null +++ b/tests/test1.nim @@ -0,0 +1,12 @@ +# This is just an example to get you started. You may wish to put all of your +# tests into a single file, or separate them into multiple `test1`, `test2` +# etc. files (better names are recommended, just make sure the name starts with +# the letter 't'). +# +# To run these tests, simply execute `nimble test`. + +import unittest + +import apatheia +test "can add": + check add(5, 5) == 10