src/debugger/test/lexer.c (view raw)
1/* Copyright (c) 2013-2017 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#include "util/test/suite.h"
7
8#include <mgba/internal/debugger/parser.h>
9
10#define LEX(STR) \
11 struct LexVector* lv = *state; \
12 lexFree(lv); \
13 LexVectorClear(lv); \
14 size_t adjusted = lexExpression(lv, STR, strlen(STR), ""); \
15 assert_false(adjusted > strlen(STR))
16
17M_TEST_SUITE_SETUP(Lexer) {
18 struct LexVector* lv = malloc(sizeof(struct LexVector));
19 LexVectorInit(lv, 0);
20 *state = lv;
21 return 0;
22}
23
24M_TEST_SUITE_TEARDOWN(Lexer) {
25 struct LexVector* lv = *state;
26 lexFree(lv);
27 LexVectorDeinit(lv);
28 free(lv);
29 return 0;
30}
31
32M_TEST_DEFINE(lexEmpty) {
33 LEX("");
34
35 assert_int_equal(LexVectorSize(lv), 0);
36}
37
38M_TEST_DEFINE(lexInt) {
39 LEX("0");
40
41 assert_int_equal(LexVectorSize(lv), 1);
42 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
43 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 0);
44}
45
46M_TEST_DEFINE(lexDecimal) {
47 LEX("10");
48
49 assert_int_equal(LexVectorSize(lv), 1);
50 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
51 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 10);
52}
53
54M_TEST_DEFINE(lexBinary) {
55 LEX("0b10");
56
57 assert_int_equal(LexVectorSize(lv), 1);
58 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
59 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 2);
60}
61
62M_TEST_DEFINE(lexSigilBinary) {
63 LEX("%10");
64
65 assert_int_equal(LexVectorSize(lv), 1);
66 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
67 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 2);
68}
69
70M_TEST_DEFINE(lexHex) {
71 LEX("0x10");
72
73 assert_int_equal(LexVectorSize(lv), 1);
74 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
75 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 0x10);
76}
77
78M_TEST_DEFINE(lexSigilHex) {
79 LEX("$10");
80
81 assert_int_equal(LexVectorSize(lv), 1);
82 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
83 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 0x10);
84}
85
86M_TEST_DEFINE(lexInvalidDecimal) {
87 LEX("1a");
88
89 assert_int_equal(LexVectorSize(lv), 1);
90 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_ERROR_TYPE);
91}
92
93M_TEST_DEFINE(lexInvalidBinary) {
94 LEX("0b12");
95
96 assert_int_equal(LexVectorSize(lv), 1);
97 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_ERROR_TYPE);
98}
99
100M_TEST_DEFINE(lexInvalidHex) {
101 LEX("0x1g");
102
103 assert_int_equal(LexVectorSize(lv), 1);
104 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_ERROR_TYPE);
105}
106
107M_TEST_DEFINE(lexTruncatedBinary) {
108 LEX("0b");
109
110 assert_int_equal(LexVectorSize(lv), 1);
111 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_ERROR_TYPE);
112}
113
114M_TEST_DEFINE(lexTruncatedSigilBinary) {
115 LEX("%");
116
117 assert_int_equal(LexVectorSize(lv), 1);
118 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_ERROR_TYPE);
119}
120
121M_TEST_DEFINE(lexTruncatedSigilHex) {
122 LEX("$");
123
124 assert_int_equal(LexVectorSize(lv), 1);
125 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_ERROR_TYPE);
126}
127
128M_TEST_DEFINE(lexTruncatedHex) {
129 LEX("0x");
130
131 assert_int_equal(LexVectorSize(lv), 1);
132 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_ERROR_TYPE);
133}
134
135M_TEST_DEFINE(lexSigilSegmentHex) {
136 LEX("$01:0010");
137
138 assert_int_equal(LexVectorSize(lv), 2);
139 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_SEGMENT_TYPE);
140 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
141 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_UINT_TYPE);
142 assert_int_equal(LexVectorGetPointer(lv, 1)->uintValue, 0x10);
143}
144
145M_TEST_DEFINE(lexIdentifier) {
146 LEX("x");
147
148 assert_int_equal(LexVectorSize(lv), 1);
149 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
150 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
151}
152
153M_TEST_DEFINE(lexAddOperator) {
154 LEX("1+");
155
156 assert_int_equal(LexVectorSize(lv), 2);
157 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
158 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
159 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
160 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_ADD);
161}
162
163M_TEST_DEFINE(lexIdentifierAddOperator) {
164 LEX("x+");
165
166 assert_int_equal(LexVectorSize(lv), 2);
167 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
168 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
169 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
170 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_ADD);
171}
172
173M_TEST_DEFINE(lexSubOperator) {
174 LEX("1-");
175
176 assert_int_equal(LexVectorSize(lv), 2);
177 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
178 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
179 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
180 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_SUBTRACT);
181}
182
183M_TEST_DEFINE(lexIdentifierSubOperator) {
184 LEX("x-");
185
186 assert_int_equal(LexVectorSize(lv), 2);
187 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
188 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
189 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
190 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_SUBTRACT);
191}
192
193M_TEST_DEFINE(lexMulOperator) {
194 LEX("1*");
195
196 assert_int_equal(LexVectorSize(lv), 2);
197 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
198 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
199 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
200 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_MULTIPLY);
201}
202
203M_TEST_DEFINE(lexIdentifierMulOperator) {
204 LEX("x*");
205
206 assert_int_equal(LexVectorSize(lv), 2);
207 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
208 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
209 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
210 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_MULTIPLY);
211}
212
213M_TEST_DEFINE(lexDivOperator) {
214 LEX("1/");
215
216 assert_int_equal(LexVectorSize(lv), 2);
217 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
218 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
219 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
220 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_DIVIDE);
221}
222
223M_TEST_DEFINE(lexIdentifierDivOperator) {
224 LEX("x/");
225
226 assert_int_equal(LexVectorSize(lv), 2);
227 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
228 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
229 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
230 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_DIVIDE);
231}
232
233M_TEST_DEFINE(lexModOperator) {
234 LEX("1%");
235
236 assert_int_equal(LexVectorSize(lv), 2);
237 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
238 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
239 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
240 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_MODULO);
241}
242
243M_TEST_DEFINE(lexIdentifierModOperator) {
244 LEX("x%");
245
246 assert_int_equal(LexVectorSize(lv), 2);
247 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
248 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
249 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
250 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_MODULO);
251}
252
253M_TEST_DEFINE(lexAndOperator) {
254 LEX("1&");
255
256 assert_int_equal(LexVectorSize(lv), 2);
257 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
258 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
259 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
260 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_AND);
261}
262
263M_TEST_DEFINE(lexIdentifierAndOperator) {
264 LEX("x&");
265
266 assert_int_equal(LexVectorSize(lv), 2);
267 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
268 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
269 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
270 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_AND);
271}
272
273M_TEST_DEFINE(lexOrOperator) {
274 LEX("1|");
275
276 assert_int_equal(LexVectorSize(lv), 2);
277 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
278 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
279 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
280 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_OR);
281}
282
283M_TEST_DEFINE(lexIdentifierOrOperator) {
284 LEX("x|");
285
286 assert_int_equal(LexVectorSize(lv), 2);
287 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
288 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
289 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
290 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_OR);
291}
292
293M_TEST_DEFINE(lexXorOperator) {
294 LEX("1^");
295
296 assert_int_equal(LexVectorSize(lv), 2);
297 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
298 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
299 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
300 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_XOR);
301}
302
303M_TEST_DEFINE(lexIdentifierXorOperator) {
304 LEX("x^");
305
306 assert_int_equal(LexVectorSize(lv), 2);
307 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
308 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
309 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
310 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_XOR);
311}
312
313M_TEST_DEFINE(lexLessOperator) {
314 LEX("1<");
315
316 assert_int_equal(LexVectorSize(lv), 2);
317 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
318 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
319 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
320 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_LESS);
321}
322
323M_TEST_DEFINE(lexIdentifierLessOperator) {
324 LEX("x<");
325
326 assert_int_equal(LexVectorSize(lv), 2);
327 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
328 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
329 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
330 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_LESS);
331}
332
333M_TEST_DEFINE(lexGreaterOperator) {
334 LEX("1>");
335
336 assert_int_equal(LexVectorSize(lv), 2);
337 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
338 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
339 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
340 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_GREATER);
341}
342
343M_TEST_DEFINE(lexIdentifierGreaterOperator) {
344 LEX("x>");
345
346 assert_int_equal(LexVectorSize(lv), 2);
347 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
348 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
349 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
350 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_GREATER);
351}
352
353M_TEST_DEFINE(lexEqualsOperator) {
354 LEX("1==");
355
356 assert_int_equal(LexVectorSize(lv), 2);
357 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
358 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
359 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
360 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_EQUAL);
361}
362
363M_TEST_DEFINE(lexIdentifierEqualsOperator) {
364 LEX("x==");
365
366 assert_int_equal(LexVectorSize(lv), 2);
367 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
368 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
369 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
370 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_EQUAL);
371}
372
373M_TEST_DEFINE(lexNotEqualsOperator) {
374 LEX("1!=");
375
376 assert_int_equal(LexVectorSize(lv), 2);
377 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
378 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
379 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
380 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_NOT_EQUAL);
381}
382
383M_TEST_DEFINE(lexIdentifierNotEqualsOperator) {
384 LEX("x!=");
385
386 assert_int_equal(LexVectorSize(lv), 2);
387 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
388 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
389 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
390 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_NOT_EQUAL);
391}
392
393M_TEST_DEFINE(lexLEOperator) {
394 LEX("1<=");
395
396 assert_int_equal(LexVectorSize(lv), 2);
397 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
398 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
399 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
400 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_LE);
401}
402
403M_TEST_DEFINE(lexIdentifierLEOperator) {
404 LEX("x<=");
405
406 assert_int_equal(LexVectorSize(lv), 2);
407 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
408 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
409 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
410 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_LE);
411}
412
413M_TEST_DEFINE(lexGEOperator) {
414 LEX("1>=");
415
416 assert_int_equal(LexVectorSize(lv), 2);
417 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
418 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
419 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
420 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_GE);
421}
422
423M_TEST_DEFINE(lexIdentifierGEOperator) {
424 LEX("x>=");
425
426 assert_int_equal(LexVectorSize(lv), 2);
427 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
428 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
429 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
430 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_GE);
431}
432
433M_TEST_DEFINE(lexLAndOperator) {
434 LEX("1&&");
435
436 assert_int_equal(LexVectorSize(lv), 2);
437 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
438 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
439 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
440 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_LOGICAL_AND);
441}
442
443M_TEST_DEFINE(lexIdentifierLAndOperator) {
444 LEX("x&&");
445
446 assert_int_equal(LexVectorSize(lv), 2);
447 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
448 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
449 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
450 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_LOGICAL_AND);
451}
452
453M_TEST_DEFINE(lexLOrOperator) {
454 LEX("1||");
455
456 assert_int_equal(LexVectorSize(lv), 2);
457 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
458 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
459 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
460 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_LOGICAL_OR);
461}
462
463M_TEST_DEFINE(lexIdentifierLOrOperator) {
464 LEX("x||");
465
466 assert_int_equal(LexVectorSize(lv), 2);
467 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
468 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
469 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
470 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_LOGICAL_OR);
471}
472
473M_TEST_DEFINE(lexShiftLOperator) {
474 LEX("1<<");
475
476 assert_int_equal(LexVectorSize(lv), 2);
477 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
478 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
479 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
480 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_SHIFT_L);
481}
482
483M_TEST_DEFINE(lexIdentifierShiftLOperator) {
484 LEX("x<<");
485
486 assert_int_equal(LexVectorSize(lv), 2);
487 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
488 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
489 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
490 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_SHIFT_L);
491}
492
493M_TEST_DEFINE(lexShiftROperator) {
494 LEX("1>>");
495
496 assert_int_equal(LexVectorSize(lv), 2);
497 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
498 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
499 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
500 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_SHIFT_R);
501}
502
503M_TEST_DEFINE(lexIdentifierShiftROperator) {
504 LEX("x>>");
505
506 assert_int_equal(LexVectorSize(lv), 2);
507 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
508 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
509 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
510 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_SHIFT_R);
511}
512
513M_TEST_DEFINE(lexEqualsInvalidOperator) {
514 LEX("1=|");
515
516 assert_int_equal(LexVectorSize(lv), 3);
517 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
518 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
519 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
520 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_ASSIGN);
521 assert_int_equal(LexVectorGetPointer(lv, 2)->type, TOKEN_ERROR_TYPE);
522}
523
524M_TEST_DEFINE(lexIdentifierEqualsInvalidOperator) {
525 LEX("x=|");
526
527 assert_int_equal(LexVectorSize(lv), 3);
528 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
529 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
530 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
531 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_ASSIGN);
532 assert_int_equal(LexVectorGetPointer(lv, 2)->type, TOKEN_ERROR_TYPE);
533}
534
535M_TEST_DEFINE(lexNotInvalidOperator) {
536 LEX("1!|");
537
538 assert_int_equal(LexVectorSize(lv), 3);
539 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
540 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
541 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
542 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_NOT);
543 assert_int_equal(LexVectorGetPointer(lv, 2)->type, TOKEN_ERROR_TYPE);
544}
545
546M_TEST_DEFINE(lexIdentifierNotInvalidOperator) {
547 LEX("x!|");
548
549 assert_int_equal(LexVectorSize(lv), 3);
550 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
551 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
552 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
553 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_NOT);
554 assert_int_equal(LexVectorGetPointer(lv, 2)->type, TOKEN_ERROR_TYPE);
555}
556
557M_TEST_DEFINE(lexLessInvalidOperator) {
558 LEX("1<|");
559
560 assert_int_equal(LexVectorSize(lv), 3);
561 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
562 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
563 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
564 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_LESS);
565 assert_int_equal(LexVectorGetPointer(lv, 2)->type, TOKEN_ERROR_TYPE);
566}
567
568M_TEST_DEFINE(lexIdentifierLessInvalidOperator) {
569 LEX("x<|");
570
571 assert_int_equal(LexVectorSize(lv), 3);
572 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
573 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
574 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
575 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_LESS);
576 assert_int_equal(LexVectorGetPointer(lv, 2)->type, TOKEN_ERROR_TYPE);
577}
578
579M_TEST_DEFINE(lexGreaterInvalidOperator) {
580 LEX("1>|");
581
582 assert_int_equal(LexVectorSize(lv), 3);
583 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
584 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
585 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
586 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_GREATER);
587 assert_int_equal(LexVectorGetPointer(lv, 2)->type, TOKEN_ERROR_TYPE);
588}
589
590M_TEST_DEFINE(lexIdentifierGreaterInvalidOperator) {
591 LEX("x>|");
592
593 assert_int_equal(LexVectorSize(lv), 3);
594 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
595 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
596 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
597 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_GREATER);
598 assert_int_equal(LexVectorGetPointer(lv, 2)->type, TOKEN_ERROR_TYPE);
599}
600
601M_TEST_DEFINE(lexAndInvalidOperator) {
602 LEX("1&|");
603
604 assert_int_equal(LexVectorSize(lv), 3);
605 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
606 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
607 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
608 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_AND);
609 assert_int_equal(LexVectorGetPointer(lv, 2)->type, TOKEN_ERROR_TYPE);
610}
611
612M_TEST_DEFINE(lexIdentifierAndInvalidOperator) {
613 LEX("x&|");
614
615 assert_int_equal(LexVectorSize(lv), 3);
616 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
617 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
618 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
619 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_AND);
620 assert_int_equal(LexVectorGetPointer(lv, 2)->type, TOKEN_ERROR_TYPE);
621}
622
623M_TEST_DEFINE(lexOrInvalidOperator) {
624 LEX("1|>");
625
626 assert_int_equal(LexVectorSize(lv), 3);
627 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
628 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
629 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
630 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_OR);
631 assert_int_equal(LexVectorGetPointer(lv, 2)->type, TOKEN_ERROR_TYPE);
632}
633
634M_TEST_DEFINE(lexIdentifierOrInvalidOperator) {
635 LEX("x|>");
636
637 assert_int_equal(LexVectorSize(lv), 3);
638 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
639 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
640 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
641 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_OR);
642 assert_int_equal(LexVectorGetPointer(lv, 2)->type, TOKEN_ERROR_TYPE);
643}
644
645M_TEST_DEFINE(lexSimpleExpression) {
646 LEX("1+1");
647
648 assert_int_equal(LexVectorSize(lv), 3);
649 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
650 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
651 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
652 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_ADD);
653 assert_int_equal(LexVectorGetPointer(lv, 2)->type, TOKEN_UINT_TYPE);
654 assert_int_equal(LexVectorGetPointer(lv, 2)->uintValue, 1);
655}
656
657M_TEST_DEFINE(lexOpenParen) {
658 LEX("(");
659
660 assert_int_equal(LexVectorSize(lv), 1);
661 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_OPEN_PAREN_TYPE);
662}
663
664M_TEST_DEFINE(lexCloseParen) {
665 LEX("(0)");
666
667 assert_int_equal(LexVectorSize(lv), 3);
668 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_OPEN_PAREN_TYPE);
669 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_UINT_TYPE);
670 assert_int_equal(LexVectorGetPointer(lv, 1)->uintValue, 0);
671 assert_int_equal(LexVectorGetPointer(lv, 2)->type, TOKEN_CLOSE_PAREN_TYPE);
672}
673
674M_TEST_DEFINE(lexIdentifierCloseParen) {
675 LEX("(x)");
676
677 assert_int_equal(LexVectorSize(lv), 3);
678 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_OPEN_PAREN_TYPE);
679 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_IDENTIFIER_TYPE);
680 assert_string_equal(LexVectorGetPointer(lv, 1)->identifierValue, "x");
681 assert_int_equal(LexVectorGetPointer(lv, 2)->type, TOKEN_CLOSE_PAREN_TYPE);
682}
683
684M_TEST_DEFINE(lexParentheticalExpression) {
685 LEX("(1+1)");
686
687 assert_int_equal(LexVectorSize(lv), 5);
688 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_OPEN_PAREN_TYPE);
689 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_UINT_TYPE);
690 assert_int_equal(LexVectorGetPointer(lv, 1)->uintValue, 1);
691 assert_int_equal(LexVectorGetPointer(lv, 2)->type, TOKEN_OPERATOR_TYPE);
692 assert_int_equal(LexVectorGetPointer(lv, 2)->operatorValue, OP_ADD);
693 assert_int_equal(LexVectorGetPointer(lv, 3)->type, TOKEN_UINT_TYPE);
694 assert_int_equal(LexVectorGetPointer(lv, 3)->uintValue, 1);
695 assert_int_equal(LexVectorGetPointer(lv, 4)->type, TOKEN_CLOSE_PAREN_TYPE);
696}
697
698M_TEST_DEFINE(lexNestedParentheticalExpression) {
699 LEX("(1+(2+3))");
700
701 assert_int_equal(LexVectorSize(lv), 9);
702 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_OPEN_PAREN_TYPE);
703 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_UINT_TYPE);
704 assert_int_equal(LexVectorGetPointer(lv, 1)->uintValue, 1);
705 assert_int_equal(LexVectorGetPointer(lv, 2)->type, TOKEN_OPERATOR_TYPE);
706 assert_int_equal(LexVectorGetPointer(lv, 2)->operatorValue, OP_ADD);
707 assert_int_equal(LexVectorGetPointer(lv, 3)->type, TOKEN_OPEN_PAREN_TYPE);
708 assert_int_equal(LexVectorGetPointer(lv, 4)->type, TOKEN_UINT_TYPE);
709 assert_int_equal(LexVectorGetPointer(lv, 4)->uintValue, 2);
710 assert_int_equal(LexVectorGetPointer(lv, 5)->type, TOKEN_OPERATOR_TYPE);
711 assert_int_equal(LexVectorGetPointer(lv, 5)->operatorValue, OP_ADD);
712 assert_int_equal(LexVectorGetPointer(lv, 6)->type, TOKEN_UINT_TYPE);
713 assert_int_equal(LexVectorGetPointer(lv, 6)->uintValue, 3);
714 assert_int_equal(LexVectorGetPointer(lv, 7)->type, TOKEN_CLOSE_PAREN_TYPE);
715 assert_int_equal(LexVectorGetPointer(lv, 8)->type, TOKEN_CLOSE_PAREN_TYPE);
716}
717
718M_TEST_DEFINE(lexSpaceSimple) {
719 LEX(" 1 ");
720
721 assert_int_equal(LexVectorSize(lv), 1);
722 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
723 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
724}
725
726M_TEST_DEFINE(lexSpaceIdentifier) {
727 LEX(" x ");
728
729 assert_int_equal(LexVectorSize(lv), 1);
730 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_IDENTIFIER_TYPE);
731 assert_string_equal(LexVectorGetPointer(lv, 0)->identifierValue, "x");
732}
733
734M_TEST_DEFINE(lexSpaceOperator) {
735 LEX("1 + 2");
736
737 assert_int_equal(LexVectorSize(lv), 3);
738 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_UINT_TYPE);
739 assert_int_equal(LexVectorGetPointer(lv, 0)->uintValue, 1);
740 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_OPERATOR_TYPE);
741 assert_int_equal(LexVectorGetPointer(lv, 1)->operatorValue, OP_ADD);
742 assert_int_equal(LexVectorGetPointer(lv, 2)->type, TOKEN_UINT_TYPE);
743 assert_int_equal(LexVectorGetPointer(lv, 2)->uintValue, 2);
744}
745
746M_TEST_DEFINE(lexSpaceParen) {
747 LEX(" ( 1 + 2 ) ");
748
749 assert_int_equal(LexVectorSize(lv), 5);
750 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_OPEN_PAREN_TYPE);
751 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_UINT_TYPE);
752 assert_int_equal(LexVectorGetPointer(lv, 1)->uintValue, 1);
753 assert_int_equal(LexVectorGetPointer(lv, 2)->type, TOKEN_OPERATOR_TYPE);
754 assert_int_equal(LexVectorGetPointer(lv, 2)->operatorValue, OP_ADD);
755 assert_int_equal(LexVectorGetPointer(lv, 3)->type, TOKEN_UINT_TYPE);
756 assert_int_equal(LexVectorGetPointer(lv, 3)->uintValue, 2);
757 assert_int_equal(LexVectorGetPointer(lv, 4)->type, TOKEN_CLOSE_PAREN_TYPE);
758}
759
760M_TEST_DEFINE(lexSpaceParens) {
761 LEX(" ( 1 + ( 2 + 3 ) ) ");
762
763 assert_int_equal(LexVectorSize(lv), 9);
764 assert_int_equal(LexVectorGetPointer(lv, 0)->type, TOKEN_OPEN_PAREN_TYPE);
765 assert_int_equal(LexVectorGetPointer(lv, 1)->type, TOKEN_UINT_TYPE);
766 assert_int_equal(LexVectorGetPointer(lv, 1)->uintValue, 1);
767 assert_int_equal(LexVectorGetPointer(lv, 2)->type, TOKEN_OPERATOR_TYPE);
768 assert_int_equal(LexVectorGetPointer(lv, 2)->operatorValue, OP_ADD);
769 assert_int_equal(LexVectorGetPointer(lv, 3)->type, TOKEN_OPEN_PAREN_TYPE);
770 assert_int_equal(LexVectorGetPointer(lv, 4)->type, TOKEN_UINT_TYPE);
771 assert_int_equal(LexVectorGetPointer(lv, 4)->uintValue, 2);
772 assert_int_equal(LexVectorGetPointer(lv, 5)->type, TOKEN_OPERATOR_TYPE);
773 assert_int_equal(LexVectorGetPointer(lv, 5)->operatorValue, OP_ADD);
774 assert_int_equal(LexVectorGetPointer(lv, 6)->type, TOKEN_UINT_TYPE);
775 assert_int_equal(LexVectorGetPointer(lv, 6)->uintValue, 3);
776 assert_int_equal(LexVectorGetPointer(lv, 7)->type, TOKEN_CLOSE_PAREN_TYPE);
777 assert_int_equal(LexVectorGetPointer(lv, 8)->type, TOKEN_CLOSE_PAREN_TYPE);
778}
779
780M_TEST_SUITE_DEFINE_SETUP_TEARDOWN(Lexer,
781 cmocka_unit_test(lexEmpty),
782 cmocka_unit_test(lexInt),
783 cmocka_unit_test(lexDecimal),
784 cmocka_unit_test(lexBinary),
785 cmocka_unit_test(lexSigilBinary),
786 cmocka_unit_test(lexHex),
787 cmocka_unit_test(lexSigilHex),
788 cmocka_unit_test(lexSigilSegmentHex),
789 cmocka_unit_test(lexInvalidDecimal),
790 cmocka_unit_test(lexInvalidHex),
791 cmocka_unit_test(lexInvalidBinary),
792 cmocka_unit_test(lexTruncatedHex),
793 cmocka_unit_test(lexTruncatedSigilHex),
794 cmocka_unit_test(lexTruncatedBinary),
795 cmocka_unit_test(lexTruncatedSigilBinary),
796 cmocka_unit_test(lexIdentifier),
797 cmocka_unit_test(lexAddOperator),
798 cmocka_unit_test(lexIdentifierAddOperator),
799 cmocka_unit_test(lexSubOperator),
800 cmocka_unit_test(lexIdentifierSubOperator),
801 cmocka_unit_test(lexMulOperator),
802 cmocka_unit_test(lexIdentifierMulOperator),
803 cmocka_unit_test(lexDivOperator),
804 cmocka_unit_test(lexIdentifierDivOperator),
805 cmocka_unit_test(lexModOperator),
806 cmocka_unit_test(lexIdentifierModOperator),
807 cmocka_unit_test(lexAndOperator),
808 cmocka_unit_test(lexIdentifierAndOperator),
809 cmocka_unit_test(lexOrOperator),
810 cmocka_unit_test(lexIdentifierOrOperator),
811 cmocka_unit_test(lexXorOperator),
812 cmocka_unit_test(lexIdentifierXorOperator),
813 cmocka_unit_test(lexLessOperator),
814 cmocka_unit_test(lexIdentifierLessOperator),
815 cmocka_unit_test(lexGreaterOperator),
816 cmocka_unit_test(lexIdentifierGreaterOperator),
817 cmocka_unit_test(lexEqualsOperator),
818 cmocka_unit_test(lexIdentifierEqualsOperator),
819 cmocka_unit_test(lexNotEqualsOperator),
820 cmocka_unit_test(lexIdentifierNotEqualsOperator),
821 cmocka_unit_test(lexLEOperator),
822 cmocka_unit_test(lexIdentifierLEOperator),
823 cmocka_unit_test(lexGEOperator),
824 cmocka_unit_test(lexIdentifierGEOperator),
825 cmocka_unit_test(lexLAndOperator),
826 cmocka_unit_test(lexIdentifierLAndOperator),
827 cmocka_unit_test(lexLOrOperator),
828 cmocka_unit_test(lexIdentifierLOrOperator),
829 cmocka_unit_test(lexShiftLOperator),
830 cmocka_unit_test(lexIdentifierShiftLOperator),
831 cmocka_unit_test(lexShiftROperator),
832 cmocka_unit_test(lexIdentifierShiftROperator),
833 cmocka_unit_test(lexEqualsInvalidOperator),
834 cmocka_unit_test(lexIdentifierEqualsInvalidOperator),
835 cmocka_unit_test(lexNotInvalidOperator),
836 cmocka_unit_test(lexIdentifierNotInvalidOperator),
837 cmocka_unit_test(lexLessInvalidOperator),
838 cmocka_unit_test(lexIdentifierLessInvalidOperator),
839 cmocka_unit_test(lexGreaterInvalidOperator),
840 cmocka_unit_test(lexIdentifierGreaterInvalidOperator),
841 cmocka_unit_test(lexAndInvalidOperator),
842 cmocka_unit_test(lexIdentifierAndInvalidOperator),
843 cmocka_unit_test(lexOrInvalidOperator),
844 cmocka_unit_test(lexIdentifierOrInvalidOperator),
845 cmocka_unit_test(lexSimpleExpression),
846 cmocka_unit_test(lexOpenParen),
847 cmocka_unit_test(lexCloseParen),
848 cmocka_unit_test(lexIdentifierCloseParen),
849 cmocka_unit_test(lexParentheticalExpression),
850 cmocka_unit_test(lexNestedParentheticalExpression),
851 cmocka_unit_test(lexSpaceSimple),
852 cmocka_unit_test(lexSpaceIdentifier),
853 cmocka_unit_test(lexSpaceOperator),
854 cmocka_unit_test(lexSpaceParen),
855 cmocka_unit_test(lexSpaceParens))