mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-24 13:39:24 +00:00
Added string classes
This commit is contained in:
parent
cb0a5194af
commit
78e7994435
13 changed files with 908 additions and 0 deletions
20
projects/SelfTest/String.tests.cpp
Normal file
20
projects/SelfTest/String.tests.cpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
#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 );
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue