Initial Course
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#include "recursion.hpp"
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
TEST(Recursion, Fibonacci) {
|
||||
EXPECT_EQ(functions::fibonacci(0), 0);
|
||||
EXPECT_EQ(functions::fibonacci(1), 1);
|
||||
EXPECT_EQ(functions::fibonacci(10), 55);
|
||||
}
|
||||
|
||||
TEST(Recursion, SumDigits) {
|
||||
EXPECT_EQ(functions::sum_digits(12345), 15);
|
||||
}
|
||||
|
||||
TEST(Recursion, IsPalindrome) {
|
||||
EXPECT_TRUE(functions::is_palindrome(121));
|
||||
EXPECT_FALSE(functions::is_palindrome(123));
|
||||
}
|
||||
Reference in New Issue
Block a user