You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hard wrap tutorial doc for easier raw Markdown reading
Hard wrap text on tutorial doc to 72 column limit, to make it easier to
be read the raw Mardown from text editor.
Also, make consistent the usage of two spaces after period.
Copy file name to clipboardExpand all lines: docs/tutorial.md
+74-58Lines changed: 74 additions & 58 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,16 +12,20 @@
12
12
13
13
## Getting Catch2
14
14
15
-
Ideally you should be using Catch2 through its [CMake integration](cmake-integration.md#top).
16
-
Catch2 also provides pkg-config files and two file (header + cpp)
17
-
distribution, but this documentation will assume you are using CMake. If
18
-
you are using the two file distribution instead, remember to replace
19
-
the included header with `catch_amalgamated.hpp`.
15
+
Ideally you should be using Catch2 through its [CMake
16
+
integration](cmake-integration.md#top). Catch2 also provides pkg-config
17
+
files and two file (header + cpp) distribution, but this documentation
18
+
will assume you are using CMake. If you are using the two file
19
+
distribution instead, remember to replace the included header with
20
+
`catch_amalgamated.hpp`.
20
21
21
22
22
23
## Writing tests
23
24
24
-
Let's start with a really simple example ([code](../examples/010-TestCase.cpp)). Say you have written a function to calculate factorials and now you want to test it (let's leave aside TDD for now).
25
+
Let's start with a really simple example
26
+
([code](../examples/010-TestCase.cpp)). Say you have written a function
27
+
to calculate factorials and now you want to test it (let's leave aside
This will compile to a complete executable which responds to [command line arguments](command-line.md#top). If you just run it with no arguments it will execute all test cases (in this case there is just one), report any failures, report a summary of how many tests passed and failed and return the number of failed tests (useful for if you just want a yes/ no answer to: "did it work").
51
+
This will compile to a complete executable which responds to [command
52
+
line arguments](command-line.md#top). If you just run it with no
53
+
arguments it will execute all test cases (in this case there is just
54
+
one), report any failures, report a summary of how many tests passed and
55
+
failed and return the number of failed tests (useful for if you just
56
+
want a yes/ no answer to: "did it work").
48
57
49
58
Anyway, as the tests above as written will pass, but there is a bug.
50
59
The problem is that `Factorial(0)` should return 1 (due to [its
0 commit comments