summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lexer_test.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/lexer_test.c b/test/lexer_test.c
index a3f644d..3c43342 100644
--- a/test/lexer_test.c
+++ b/test/lexer_test.c
@@ -78,6 +78,16 @@ test_tokenize_number(const MunitParameter params[], void *user_data_or_fixture)
}
static MunitResult
+test_tokenize_name(const MunitParameter params[], void *user_data_or_fixture)
+{
+ assert_token_at("myname", 0, TOKEN_NAME, "myname");
+ assert_token_at("my_name", 0, TOKEN_NAME, "my_name");
+ assert_token_at("myname2", 0, TOKEN_NAME, "myname2");
+
+ return MUNIT_OK;
+}
+
+static MunitResult
test_tokenize_op(const MunitParameter params[], void *user_data_or_fixture)
{
assert_token_at(" + 2", 0, TOKEN_PLUS, "+");
@@ -123,6 +133,7 @@ test_peek_next_token(const MunitParameter params[], void *user_data_or_fixture)
static MunitTest tests[] = {
{ "/test_tokenize_digit", test_tokenize_number, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL },
{ "/test_tokenize_keywords", test_tokenize_keywords, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL },
+ { "/test_tokenize_name", test_tokenize_name, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL },
{ "/test_tokenize_op", test_tokenize_op, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL },
{ "/test_tokenize_unknown", test_tokenize_unknown, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL },
{ "/test_peek_next_token", test_peek_next_token, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL },