From 087a775e35242131fc13594c988c4a0d91563d5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Geron?= Date: Thu, 22 Aug 2024 19:02:51 +1200 Subject: [PATCH] Swap docs/TESTS.md with exercises/shared/.docs/tests.md (#5) * Swap docs/TESTS.md with exercises/shared/.docs/tests.md * Update docs/TESTS.md Co-authored-by: Erik Schierboom * Update exercises/shared/.docs/tests.md Co-authored-by: Erik Schierboom --------- Co-authored-by: Erik Schierboom --- docs/TESTS.md | 41 +++++++++++++++++++++++++++++++-- exercises/shared/.docs/tests.md | 41 ++------------------------------- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/docs/TESTS.md b/docs/TESTS.md index ffe0aec..6d19f32 100644 --- a/docs/TESTS.md +++ b/docs/TESTS.md @@ -1,5 +1,42 @@ # Tests -Roc comes with its own integrated test tools, no need to install anything else. +To download an exercise, for example `hello-world`, open a terminal and run: -To test your solution to an exercise, open a terminal, go to the exercise directory, run `roc test -test.roc`, for example `roc test hello-world-test.roc`, and ensure that all the tests pass. +```bash +exercism download --track roc --exercise hello-world +``` + +Then go to the exercise directory and edit the code to solve the exercise. For example: + +```bash +cd {your Exercism folder}/roc/hello-world +edit HelloWorld.roc +``` + +Each exercise comes with a test suite. You can run the tests using the `roc test` command, for example: + +``` +roc test hello-world-test.roc +``` + +If you've solved the exercise, you should see 0 failed test, for example: + +``` +0 failed and 1 passed in 583 ms. +``` + +However, if your code has any errors, they will look like this: + +``` +── EXPECT FAILED in hello-world-test.roc ─────────────────────────────────────── + +This expectation failed: + +6│ expect hello == "Hello, World!" + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + +1 failed and 0 passed in 1264 ms. +``` + +This should help you fix your code. Once your code works, you can submit it using the `exercism submit` command (see `HELP.md` in the exercise directory for more details). diff --git a/exercises/shared/.docs/tests.md b/exercises/shared/.docs/tests.md index aeaf21f..d3384ff 100644 --- a/exercises/shared/.docs/tests.md +++ b/exercises/shared/.docs/tests.md @@ -1,42 +1,5 @@ # Testing on the Command Line -To download an exercise, for example `hello-world`, open a terminal and run: +Roc comes with its own integrated test tools, no need to install anything else. -```bash -exercism download --track roc --exercise hello-world -``` - -Then go to the exercise directory and edit the code to solve the exercise. For example: - -```bash -cd {your Exercism folder}/roc/hello-world -edit HelloWorld.roc -``` - -Each exercise comes with a test suite. You can run the tests using the `roc test` command, for example: - -``` -roc test hello-world-test.roc -``` - -If you've solved the exercise, you should see 0 failed test, for example: - -``` -0 failed and 1 passed in 583 ms. -``` - -However, if your code has any errors, they will look like this: - -``` -── EXPECT FAILED in hello-world-test.roc ─────────────────────────────────────── - -This expectation failed: - -6│ expect hello == "Hello, World!" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - -1 failed and 0 passed in 1264 ms. -``` - -This should help you fix your code. Once your code works, you can submit it using the `exercism submit` command (see `HELP.md` in the exercise directory for more details). +To test your solution to an exercise, open a terminal, go to the exercise directory, run `roc test -test.roc`, for example `roc test hello-world-test.roc`, and ensure that all the tests pass.