File: tests-stringset.cpp

package info (click to toggle)
xmlcopyeditor 1.3.1.0-1.2
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 24,528 kB
  • sloc: xml: 140,240; cpp: 29,372; sh: 4,925; makefile: 299; sed: 16
file content (19 lines) | stat: -rw-r--r-- 478 bytes parent folder | download | duplicates (3)
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);
}