68 checkSymbolCreation();
83 CHECK (
sizeof(
Literal) ==
sizeof(
char*));
86 CHECK (!isSameObject (li1,li2));
91 CHECK (
"string" == typeStr (li1 +
string{
"night"}));
92 CHECK (
"string" == typeStr (
string{
"minus " +li1}));
93 cout << li1 +
string{
"night"} << endl;
94 cout <<
string{
"minus " +li1} << endl;
95 cout << li2+string(
"..") << string(
"..")+li2 << endl;
112 CHECK (!isnil (nnn));
117 checkSymbolCreation()
124 CHECK (not isSameObject (l1,sy1));
125 CHECK (not isSameObject (sy1,sy2));
126 CHECK (l1.c() != sy1.c());
127 CHECK (sy1.c() == sy2.c());
136 CHECK (sy3 ==
Symbol{
"⟂"});
137 CHECK (sy3.c() ==
Symbol{
"⟂"}.c());
141 CHECK (Symbol::EMPTY ==
Symbol{
""});
142 CHECK (Symbol::BOTTOM ==
Symbol{
"⟂"});
143 CHECK (Symbol::EMPTY != Symbol::BOTTOM);
144 CHECK (
Symbol{
nullptr} == Symbol::BOTTOM);
145 CHECK (Symbol::EMPTY.empty());
146 CHECK (Symbol::BOTTOM.empty());
147 CHECK (not Symbol::FAILURE.empty());
148 CHECK (isnil (
Symbol{
"⟂"}));
149 CHECK (isnil (
Symbol{
""}));
157 CHECK (sy4 ==
"1.11");
158 CHECK (not isSameObject(sy4.c(),
"1.11"));
159 CHECK (sy4.c() ==
Symbol{
"1.11"}.c());
160 CHECK (sy4.c() == (
const char*)sy4);
168 const char* s1 =
"1";
169 const char* s3 =
"11";
170 const char* s2 = s3+1;
192 CHECK (not isSameObject(l1, l2));
193 CHECK (not isSameObject(l1.c(), l2.c()));
200 CHECK (y1.c() == y2.c());
201 CHECK (not isSameObject (y1.c(), y2.c()));
202 CHECK ( isSameObject (*y1.c(), *y2.c()));
208 CHECK (y1 == l1); CHECK (l1 == y1);
209 CHECK (y1 == s1); CHECK (s1 == y1);
210 CHECK (y1 == l2); CHECK (l2 == y1);
211 CHECK (y1 == s2); CHECK (s2 == y1);
212 CHECK (y3 != l1); CHECK (l1 != y3);
213 CHECK (y3 != s1); CHECK (s1 != y3);
214 CHECK (y3 != l2); CHECK (l2 != y3);
215 CHECK (y3 != s2); CHECK (s2 != y3);
228 map<Literal, int> mli;
229 map<Symbol, int> myi;
230 map<string, int> msi;
234 string s1{y1}, s2{
"2"};
236 mli[l1] = 1; myi[y1] = 1; msi[s1] = 1;
237 mli[l2] = 2; myi[y2] = 2; msi[s2] = 2;
239 CHECK (mli[l1] == 1);
240 CHECK (mli[l2] == 2);
241 CHECK (myi[y1] == 1);
242 CHECK (myi[y2] == 2);
243 CHECK (msi[s1] == 1);
244 CHECK (msi[s2] == 2);
246 const char* x =
"11";
inline string literal This is a marker type to indicate that
string showSizeof(size_t siz, string name)
for printing sizeof().
Implementation namespace for support and library code.
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 isSameObject(A const &a, B const &b)
compare plain object identity, bypassing any custom comparison operators.