mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2025-11-17 06:37:43 -05:00
* apply clang-format and cmake-format and add style check workflow * add declare package definition * add additional public methods and rename internals * change development verison tag to 1.0.0 * rename internal method * rename public method * rename test var * update copyright and fix comment * typo * run fix-format * fix test function names
22 lines
441 B
C++
22 lines
441 B
C++
#define CATCH_CONFIG_MAIN
|
|
|
|
#include <fibonacci.h>
|
|
|
|
#include <catch2/catch.hpp>
|
|
|
|
TEST_CASE("fibonacci") {
|
|
REQUIRE(fibonacci(0) == 0);
|
|
REQUIRE(fibonacci(1) == 1);
|
|
REQUIRE(fibonacci(2) == 1);
|
|
REQUIRE(fibonacci(3) == 2);
|
|
REQUIRE(fibonacci(4) == 3);
|
|
REQUIRE(fibonacci(5) == 5);
|
|
REQUIRE(fibonacci(13) == 233);
|
|
}
|
|
|
|
TEST_CASE("fastFibonacci") {
|
|
for (unsigned i = 0; i < 25; ++i) {
|
|
REQUIRE(fibonacci(i) == fastFibonacci(i));
|
|
}
|
|
}
|