45 using lumiera::error::LUMIERA_ERROR_LOGIC;
49 using DataSeq = vector<string>;
52 #define TOK(id) id(STRINGIFY(id)) 54 string TOK(a1), TOK(a2), TOK(a3), TOK(a4), TOK(a5);
55 string TOK(b1), TOK(b2), TOK(b3), TOK(b4);
94 DataSeq data({a5,a2,a1,a4,a3});
97 CHECK (5 == idx.size());
99 CHECK (idx.contains(a1));
100 CHECK (idx.contains(a2));
101 CHECK (idx.contains(a3));
102 CHECK (idx.contains(a4));
103 CHECK (idx.contains(a5));
105 CHECK (!idx.contains(b1));
106 CHECK (!idx.contains(b2));
109 CHECK (a5 == idx.getElement(0));
110 CHECK (a2 == idx.getElement(1));
111 CHECK (a1 == idx.getElement(2));
112 CHECK (a4 == idx.getElement(3));
113 CHECK (a3 == idx.getElement(4));
116 CHECK (0 == idx.pos(a5));
117 CHECK (1 == idx.pos(a2));
118 CHECK (2 == idx.pos(a1));
119 CHECK (3 == idx.pos(a4));
120 CHECK (4 == idx.pos(a3));
127 DataSeq data({a5,a2,a1,a4,a3});
133 CHECK (5 == idx.size());
135 CHECK (idx.contains(a1));
136 CHECK (idx.contains(a2));
137 CHECK (idx.contains(a3));
138 CHECK (idx.contains(a4));
139 CHECK (idx.contains(a5));
141 CHECK (!idx.contains(b1));
142 CHECK (!idx.contains(b2));
144 CHECK (0 == idx.pos(a5));
145 CHECK (1 == idx.pos(a2));
146 CHECK (2 == idx.pos(a1));
147 CHECK (3 == idx.pos(a4));
148 CHECK (4 == idx.pos(a3));
155 DataSeq data({a5,a2,a1,a4,a3});
158 for (
auto elm : Index(data))
160 CHECK (elm == data[i++]);
168 DataSeq data({a5,a2,a1,a4,a2,a3});
177 DataSeq seqA({a5,a4,a1,a2,a3});
178 DataSeq seqB({b4,b3,b2,b1});
182 CHECK (5 == idxA.size());
183 CHECK (4 == idxB.size());
185 CHECK ( idxA.contains(a1));
186 CHECK (!idxA.contains(b1));
187 CHECK (!idxB.contains(a1));
188 CHECK ( idxB.contains(b1));
192 CHECK (!idxA.contains(a1));
193 CHECK ( idxA.contains(b1));
194 CHECK ( idxB.contains(a1));
195 CHECK (!idxB.contains(b1));
198 CHECK (4 == idxA.size());
199 CHECK (4 == idxB.size());
201 CHECK (!idxA.contains(a1));
202 CHECK ( idxA.contains(b1));
203 CHECK (!idxB.contains(a1));
204 CHECK ( idxB.contains(b1));
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
Implementation namespace for support and library code.
Simple test class runner.
data snapshot and lookup table
Generic lookup table for a sequence of unique values.
A collection of frequently used helper functions to support unit testing.