Menu

[3c79ba]: / tests / tests-stringset.cpp  Maximize  Restore  History

Download this file

20 lines (15 with data), 478 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#include "catch.hpp"
#include <string>
#include <memory>
#include "../src/stringset.h"
TEST_CASE( "stringset works as specified", "[stringset]" ) {
std::string buf = "test";
std::auto_ptr<StringSet<char> > dict ( new StringSet<char>() );
REQUIRE( dict->find(buf) == 0 );
REQUIRE( dict->empty() == true );
REQUIRE( dict->count() == 0 );
dict->insert(buf);
REQUIRE( dict->find(buf) != 0 );
REQUIRE( dict->empty() == false);
REQUIRE( dict->count() == 1);
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.