/*
* @Author: "william"
* @Date: 2020-10-19 17:21:32
* @Last Modified by: "william"
* @Last Modified time: 2020-10-19 17:29:18
*/#define CATCH_CONFIG_RUNNER
#include"catch.hpp"intmain(intargc,char*argv[]){intres=Catch::Session().run(argc,argv);returnres;// =========================================================================
// Catch::Session session; // There must be exactly one instance
// int height = 0; // Some user variable you want to be able to set
// // Build a new parser on top of Catch's
// using namespace Catch::clara;
// auto cli
// = session.cli() // Get Catch's composite command line parser
// | Opt( height, "height" ) // bind variable to a new option, with a hint string
// ["-g"]["--height"] // the option names it will respond to
// ("how high?"); // description string for the help output
// // Now pass the new composite back to Catch so it uses that
// session.cli( cli );
// // Let Catch (using Clara) parse the command line
// int returnCode = session.applyCommandLine( argc, argv );
// if( returnCode != 0 ) // Indicates a command line error
// return returnCode;
// return session.run();
// =========================================================================
}intFactorial(intnumber){returnnumber<=1?number:Factorial(number-1)*number;// fail
// return number <= 1 ? 1 : Factorial( number - 1 ) * number; // pass
}TEST_CASE("Factorial of 0 is 1 (fail)","[single-file]"){REQUIRE(Factorial(0)==1);}TEST_CASE("Factorials of 1 and higher are computed (pass)","[single-file]"){REQUIRE(Factorial(1)==1);REQUIRE(Factorial(2)==2);REQUIRE(Factorial(3)==6);REQUIRE(Factorial(10)==3628800);}