35 #include <boost/functional/hash.hpp> 36 #include <unordered_map> 61 typedef std::unordered_map< Symbol, string, hash<Symbol>> HTable;
81 table[KEY1] = string (KEY1);
82 table[KEY2] = string (KEY2);
83 table[KEY3] = string (KEY3);
84 table[KEY4] = string (KEY4);
86 CHECK (!isnil(table));
87 CHECK (4 == table.size());
88 CHECK (contains (table, KEY1));
89 CHECK (contains (table, KEY2));
90 CHECK (contains (table, KEY3));
91 CHECK (contains (table, KEY4));
92 CHECK (!contains (table, KEY5));
94 CHECK (
string (KEY1) == table[KEY1]);
95 CHECK (
string (KEY2) == table[KEY2]);
96 CHECK (
string (KEY3) == table[KEY3]);
97 CHECK (
string (KEY4) == table[KEY4]);
100 CHECK (
string(KEY3) != table[KEY3]);
101 CHECK (
string(KEY3)+
"..." == table[KEY3]);
103 CHECK (isnil (table[KEY5]));
104 CHECK (5 == table.size());
113 string copy1(random);
116 string copy2(random);
124 Literal l52 (random.substr(0,5).c_str());
inline string literal This is a marker type to indicate that
const size_t STRING_MAX_RELEVANT
safety guard: maximum number of chars to process.
Implementation namespace for support and library code.
string randStr(size_t len)
create garbage string of given length
Token or Atom with distinct identity.
Marker types to indicate a literal string and a Symbol.
Simple test class runner.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
A collection of frequently used helper functions to support unit testing.
HashVal hash_value(QueryText const &entry)
support using queries in hashtables.
bool contains(SEQ const &cont, typename SEQ::const_reference val)
shortcut for brute-force containment test in any sequential container