From 88ec3e0c9ce9e25f70374f74fded62d3ec635222 Mon Sep 17 00:00:00 2001 From: philsquared Date: Sat, 2 Jun 2012 09:33:15 -0700 Subject: [PATCH] Updated Tutorial (markdown) --- Tutorial.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tutorial.md b/Tutorial.md index 9e0da8e..3a4a30f 100644 --- a/Tutorial.md +++ b/Tutorial.md @@ -34,7 +34,7 @@ To keep things simple we'll put everything in a single file. return number <= 1 ? number : Factorial(number-1)*number; } - TEST_CASE( "example/factorial", "The Factorial function should return the factorial of the number passed in" ) { + TEST_CASE( "example/factorial", "The Factorial function returns the factorial of the number passed in" ) { REQUIRE( Factorial(1) == 1 ); REQUIRE( Factorial(2) == 2 ); REQUIRE( Factorial(3) == 6 ); @@ -53,7 +53,7 @@ What is the bug? Well what is the factorial of zero? Let's add that to the test case: ```C++ - TEST_CASE( "example/factorial", "The Factorial function should return the factorial of the number passed in" ) { + TEST_CASE( "example/factorial", "The Factorial function returns the factorial of the number passed in" ) { REQUIRE( Factorial(0) == 1 ); REQUIRE( Factorial(1) == 1 ); REQUIRE( Factorial(2) == 2 ); @@ -65,7 +65,7 @@ Let's add that to the test case: Now we get a failure - something like: ``` -Example.cpp:291: Factorial(0) == 1 failed for: 0 == 1 +Example.cpp:9: Factorial(0) == 1 failed for: 0 == 1 ``` Note that we get the actual return value of Factorial(0) printed for us (0) - even though we used a natural expression with the == operator. That let's us immediately see what the problem is.