blob: 496e709e6cbf3d93b5b659fcb2d08c8a23e99a38 [file] [log] [blame]
onqtamb8220c52017-05-16 00:21:15 +03001#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
2#include "doctest.h"
3
4static int factorial(int number) { return number <= 1 ? number : factorial(number - 1) * number; }
5
6TEST_CASE("testing the factorial function") {
7 CHECK(factorial(0) == 1);
8 CHECK(factorial(1) == 1);
9 CHECK(factorial(2) == 2);
10 CHECK(factorial(3) == 6);
11 CHECK(factorial(10) == 3628800);
12}