Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Chris Müller
cherry
Commits
0ffe0cee
Commit
0ffe0cee
authored
Jul 06, 2013
by
Chris Müller
Browse files
add testcase for elementary delimiter literals
parent
9e10f4e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/lex.c
View file @
0ffe0cee
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment