Commit 0ffe0cee authored by Chris Müller's avatar Chris Müller
Browse files

add testcase for elementary delimiter literals

parent 9e10f4e2
......@@ -144,8 +144,26 @@ static void test_lex_characters(const_pointer data)
}
static void test_lex_core(const_pointer data)
{
byte_t* str = " [ ] ( ) . ' ";
struct CyContext* c = cy_context_repl_new(str);
assert(cy_lex(c) == TOK_SQUARELEFTBRACE);
assert(cy_lex(c) == TOK_SQUARERIGHTBRACE);
assert(cy_lex(c) == TOK_ROUNDLEFTBRACE);
assert(cy_lex(c) == TOK_ROUNDRIGHTBRACE);
assert(cy_lex(c) == TOK_DOT);
assert(cy_lex(c) == TOK_QUOTE);
assert(cy_lex(c) == TOK_EOF);
cy_context_free(c);
}
void test_suite_lex()
{
cry_unittest_run("org.cherry.parser/lex_core", test_lex_core, 0, 100);
cry_unittest_run("org.cherry.parser/lex_fixnum", test_lex_fixnum, 0, 100);
cry_unittest_run("org.cherry.parser/lex_float", test_lex_float, 0, 100);
cry_unittest_run("org.cherry.parser/lex_string", test_lex_string, 0, 100);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment