26#include <boost/functional/hash.hpp>
27#include <unordered_map>
52 typedef std::unordered_map< Symbol, string, hash<Symbol>>
HTable;
73 table[KEY1] = string (KEY1);
74 table[KEY2] = string (KEY2);
75 table[KEY3] = string (KEY3);
76 table[KEY4] = string (KEY4);
78 CHECK (!isnil(table));
79 CHECK (4 == table.size());
80 CHECK (contains (table, KEY1));
81 CHECK (contains (table, KEY2));
82 CHECK (contains (table, KEY3));
83 CHECK (contains (table, KEY4));
84 CHECK (!contains (table, KEY5));
86 CHECK (
string (KEY1) == table[KEY1]);
87 CHECK (
string (KEY2) == table[KEY2]);
88 CHECK (
string (KEY3) == table[KEY3]);
89 CHECK (
string (KEY4) == table[KEY4]);
92 CHECK (
string(KEY3) != table[KEY3]);
93 CHECK (
string(KEY3)+
"..." == table[KEY3]);
95 CHECK (isnil (table[KEY5]));
96 CHECK (5 == table.size());
105 string copy1(random);
108 string copy2(random);
116 Literal l52 (random.substr(0,5).c_str());
Token or Atom with distinct identity.
std::unordered_map< Symbol, string, hash< Symbol > > HTable
string randStr(size_t len)
create garbage string of given length
Implementation namespace for support and library code.
int rani(uint bound=_iBOUND())
const size_t STRING_MAX_RELEVANT
safety guard: maximum number of chars to process.
HashVal hash_value(QueryText const &entry)
support using queries in hashtables.
Test runner and basic definitions for tests.
bool contains(MAP &map, typename MAP::key_type const &key)
shortcut for containment test on a map
bool isnil(lib::time::Duration const &dur)
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
Marker types to indicate a literal string and a Symbol.
A collection of frequently used helper functions to support unit testing.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...