catch2/projects/SelfTest/String.tests.cpp

20 lines
471 B
C++
Raw Normal View History

2017-06-29 12:18:14 +02:00
#include "../include/internal/catch_string.h"
#include "catch.hpp"
TEST_CASE( "String", "[Strings]" ) {
using Catch::String;
SECTION( "empty string" ) {
String empty;
REQUIRE( empty.empty() );
REQUIRE( empty.size() == 0 );
REQUIRE( std::strcmp( empty.c_str(), "" ) == 0 );
}
SECTION( "from literal" ) {
String s = "hello";
REQUIRE( s.empty() == false );
REQUIRE( s.size() == 5 );
}
}