| 11 | #include <catch2/catch_test_macros.hpp> |
| 12 | |
| 13 | static int Factorial( int number ) { |
| 14 | return number <= 1 ? number : Factorial( number - 1 ) * number; // fail |
| 15 | // return number <= 1 ? 1 : Factorial( number - 1 ) * number; // pass |
| 16 | } |
| 17 | |
| 18 | TEST_CASE( "Factorial of 0 is 1 (fail)", "[single-file]" ) { |
| 19 | REQUIRE( Factorial(0) == 1 ); |