feat: add NULL type and literal union type
This commit is contained in:
parent
0ced372a77
commit
06260d0a8f
12 changed files with 125 additions and 68 deletions
|
|
@ -175,4 +175,20 @@ void test_evaluation()
|
|||
assert(resType == TYPE_INT);
|
||||
printf("actually got: %d \n", resVal);
|
||||
assert(7 == resVal);
|
||||
|
||||
evaluate(state, "is_number(123)", &resVal, &resType);
|
||||
assert(resType == TYPE_INT);
|
||||
assert(resVal);
|
||||
|
||||
evaluate(state, "is_number(-25.5)", &resVal, &resType);
|
||||
assert(resType == TYPE_INT);
|
||||
assert(resVal);
|
||||
|
||||
evaluate(state, "is_number(NULL)", &resVal, &resType);
|
||||
assert(resType == TYPE_INT);
|
||||
assert(!resVal);
|
||||
|
||||
evaluate(state, "is_null(NULL)", &resVal, &resType);
|
||||
assert(resType == TYPE_INT);
|
||||
assert(resVal);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue