From d7c603738d09fc3e5ae0d25179d24c2ec1290dfc Mon Sep 17 00:00:00 2001 From: apprentiLAB-Suzanne <73226532+apprentiLAB-Suzanne@users.noreply.github.com> Date: Thu, 7 Sep 2023 09:47:11 +0200 Subject: [PATCH 1/2] Update tests.md Added example about where to find the line to move past the next test. --- exercises/shared/.docs/tests.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/exercises/shared/.docs/tests.md b/exercises/shared/.docs/tests.md index 0a1ad0d1..f906b9ad 100644 --- a/exercises/shared/.docs/tests.md +++ b/exercises/shared/.docs/tests.md @@ -5,7 +5,8 @@ Detailed instructions on how to do this can be found on the [Running the Tests][ ## Passing the Tests -Get the first test compiling, linking and passing by following the [three rules of test-driven development][three-laws-of-tdd]. +When you start a new exercise locally, the files are configured so that only the first test is performed. +Get that first test compiling, linking and passing by following the [three rules of test-driven development][three-laws-of-tdd]. Create just enough structure by declaring namespaces, functions, classes, etc., to satisfy any compiler errors and get the test to fail. Then write just enough code to get the test to pass. Once you've done that, uncomment the next test by moving the following line past the next test. @@ -14,7 +15,9 @@ Once you've done that, uncomment the next test by moving the following line past #if defined(EXERCISM_RUN_ALL_TESTS) ``` -This may result in compile errors as new constructs may be invoked that you haven't yet declared or defined. +For `bob` exercise, for example, you will find that line in file `bob_test.cpp`, on line 15. + +Moving this line past the next test may result in compile errors as new constructs may be invoked that you haven't yet declared or defined. Again, fix the compile errors minimally to get a failing test, then change the code minimally to pass the test, refactor your implementation for readability and expressiveness and then go on to the next test. Try to use standard C++17 facilities in preference to writing your own low-level algorithms or facilities by hand. From 0022ee0932cd2b1a6875b74da6b08f20d3278540 Mon Sep 17 00:00:00 2001 From: apprentiLAB-Suzanne <73226532+apprentiLAB-Suzanne@users.noreply.github.com> Date: Tue, 12 Sep 2023 16:02:06 +0200 Subject: [PATCH 2/2] Update tests.md with example from bob_test.cpp --- exercises/shared/.docs/tests.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/exercises/shared/.docs/tests.md b/exercises/shared/.docs/tests.md index f906b9ad..af9b10b7 100644 --- a/exercises/shared/.docs/tests.md +++ b/exercises/shared/.docs/tests.md @@ -9,13 +9,18 @@ When you start a new exercise locally, the files are configured so that only the Get that first test compiling, linking and passing by following the [three rules of test-driven development][three-laws-of-tdd]. Create just enough structure by declaring namespaces, functions, classes, etc., to satisfy any compiler errors and get the test to fail. Then write just enough code to get the test to pass. -Once you've done that, uncomment the next test by moving the following line past the next test. +Once you've done that, uncomment the next test by moving the line `if defined(EXERCISM_RUN_ALL_TESTS)` past the next test. -```C++ -#if defined(EXERCISM_RUN_ALL_TESTS) -``` +See the example below from the Bob exercise (file `bob_test.cpp`, line 15): -For `bob` exercise, for example, you will find that line in file `bob_test.cpp`, on line 15. +```diff +-#if defined(EXERCISM_RUN_ALL_TESTS) +TEST_CASE("shouting") +{ + REQUIRE("Whoa, chill out!" == bob::hey("WATCH OUT!")); +} ++#if defined(EXERCISM_RUN_ALL_TESTS) +``` Moving this line past the next test may result in compile errors as new constructs may be invoked that you haven't yet declared or defined. Again, fix the compile errors minimally to get a failing test, then change the code minimally to pass the test, refactor your implementation for readability and expressiveness and then go on to the next test.