mirror of
https://github.com/ttroy50/cmake-examples.git
synced 2025-12-18 12:14:36 +03:00
37 lines
542 B
C++
37 lines
542 B
C++
#include <string>
|
|
#include "Reverse.h"
|
|
#include "Palindrome.h"
|
|
|
|
#define CATCH_CONFIG_MAIN
|
|
#include "catch2/catch.hpp"
|
|
|
|
|
|
TEST_CASE( "simple" )
|
|
{
|
|
std::string toRev = "Hello";
|
|
|
|
Reverse rev;
|
|
std::string res = rev.reverse(toRev);
|
|
|
|
REQUIRE( res == "olleH" );
|
|
}
|
|
|
|
TEST_CASE( "empty" )
|
|
{
|
|
std::string toRev;
|
|
|
|
Reverse rev;
|
|
std::string res = rev.reverse(toRev);
|
|
|
|
REQUIRE( res == "" );
|
|
}
|
|
|
|
TEST_CASE( "is_palindrome" )
|
|
{
|
|
std::string pal = "mom";
|
|
Palindrome pally;
|
|
|
|
REQUIRE( pally.isPalindrome(pal) == true );
|
|
|
|
}
|