WhisperCom/.conan/test_package/test_package.cpp
Dominik Meyer 9266232d41 Squashed 'libs/Catch2/' content from commit a05a54ec
git-subtree-dir: libs/Catch2
git-subtree-split: a05a54ec25d2854b27afd38afa605fa6e3a36430
2021-08-19 17:00:44 +02:00

15 lines
380 B
C++

#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
int Factorial( int number ) {
return number <= 1 ? 1 : Factorial( number - 1 ) * number;
}
TEST_CASE( "Factorial Tests", "[single-file]" ) {
REQUIRE( Factorial(0) == 1 );
REQUIRE( Factorial(1) == 1 );
REQUIRE( Factorial(2) == 2 );
REQUIRE( Factorial(3) == 6 );
REQUIRE( Factorial(10) == 3628800 );
}