summaryrefslogtreecommitdiff
path: root/tests/tests.cc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-02-24 20:48:58 -0500
committerbd <bdunahu@operationnull.com>2025-02-24 20:48:58 -0500
commit428cdf3d8be3d46ca071967596083da98840fbbd (patch)
tree802210ed60b768892bce8172ac2d5a686149b868 /tests/tests.cc
parent9028b78a0d668a8893d4e5ce65fa1d332be35cfa (diff)
Add catch2 testing framework and integrate with CMake
Diffstat (limited to 'tests/tests.cc')
-rw-r--r--tests/tests.cc11
1 files changed, 11 insertions, 0 deletions
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 );
+}