From 428cdf3d8be3d46ca071967596083da98840fbbd Mon Sep 17 00:00:00 2001 From: bd Date: Mon, 24 Feb 2025 20:48:58 -0500 Subject: Add catch2 testing framework and integrate with CMake --- tests/tests.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/tests.cc (limited to 'tests/tests.cc') diff --git a/tests/tests.cc b/tests/tests.cc new file mode 100644 index 0000000..d866172 --- /dev/null +++ b/tests/tests.cc @@ -0,0 +1,11 @@ +#define CATCH_CONFIG_MAIN +#include "catch2/catch.hpp" +#include "fact.h" + +TEST_CASE( "factorials are computed", "[factorial]") +{ + REQUIRE( factorial(1) == 1 ); + REQUIRE( factorial(2) == 2 ); + REQUIRE( factorial(3) == 6 ); + REQUIRE( factorial(10) == 3628800 ); +} -- cgit v1.2.3