feat: add NULL type and literal union type

This commit is contained in:
Matthieu Bessat 2022-05-17 09:01:58 +02:00
parent 0ced372a77
commit 06260d0a8f
12 changed files with 125 additions and 68 deletions

View file

@ -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);
}