From b1adfc12b7b20fd47a98a4e06624e9fe08b602af Mon Sep 17 00:00:00 2001 From: ee7 <45465154+ee7@users.noreply.github.com> Date: Wed, 6 Mar 2019 20:00:03 +0100 Subject: [PATCH] Convert track to Nimble Closes: #89 --- exercises/hello-world/hello_world.nimble | 27 +++++++++++++++++++ exercises/hello-world/src/hello_world.nim | 2 ++ exercises/hello-world/tests/config.nims | 1 + .../test_hello_world.nim} | 0 4 files changed, 30 insertions(+) create mode 100644 exercises/hello-world/hello_world.nimble create mode 100644 exercises/hello-world/src/hello_world.nim create mode 100644 exercises/hello-world/tests/config.nims rename exercises/hello-world/{hello_world_test.nim => tests/test_hello_world.nim} (100%) diff --git a/exercises/hello-world/hello_world.nimble b/exercises/hello-world/hello_world.nimble new file mode 100644 index 00000000..279e4c54 --- /dev/null +++ b/exercises/hello-world/hello_world.nimble @@ -0,0 +1,27 @@ +# Package +version = "1.0" +author = "exercism.io contributors" +description = "hello-world" +license = "MIT" +srcDir = "src" + + +# Dependencies +requires "nim >= 0.19.4" + + +# Helper function +proc test(name: string) = + if not dirExists "build": + mkDir "build" + switch("out", ("./build/" & name)) + --run + --verbosity:0 + --hint[Processing]:off +# --path: "../src" + setCommand "c", "tests/" & name & ".nim" + + +# Tasks +task test, "Run the tests for this exercise": + test "test_hello_world" diff --git a/exercises/hello-world/src/hello_world.nim b/exercises/hello-world/src/hello_world.nim new file mode 100644 index 00000000..91a6f5ec --- /dev/null +++ b/exercises/hello-world/src/hello_world.nim @@ -0,0 +1,2 @@ +proc hello*: string = + "Goodbye, World!" diff --git a/exercises/hello-world/tests/config.nims b/exercises/hello-world/tests/config.nims new file mode 100644 index 00000000..bca9644b --- /dev/null +++ b/exercises/hello-world/tests/config.nims @@ -0,0 +1 @@ +--path: "$projectDir/../src" diff --git a/exercises/hello-world/hello_world_test.nim b/exercises/hello-world/tests/test_hello_world.nim similarity index 100% rename from exercises/hello-world/hello_world_test.nim rename to exercises/hello-world/tests/test_hello_world.nim