Debian Codegraph @

3rdparty/catch2/.conan/test_package/test_package.cpp

raw
1 #include <catch2/catch_test_macros.hpp>
2
3 int Factorial( int number ) {
4 return number <= 1 ? 1 : Factorial( number - 1 ) * number;
5 }
6
7 TEST_CASE( "Factorial Tests", "[single-file]" ) {
8 REQUIRE( Factorial(0) == 1 );
9 REQUIRE( Factorial(1) == 1 );
10 REQUIRE( Factorial(2) == 2 );
11 REQUIRE( Factorial(3) == 6 );
12 REQUIRE( Factorial(10) == 3628800 );
13 }