aboutsummaryrefslogtreecommitdiff
path: root/test/symbolic/klee/viml_expressions_parser.c
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-10-16 00:39:48 +0300
committerZyX <kp-pav@yandex.ru>2017-10-16 00:39:48 +0300
commited253b5fe6515840fe6dd9df83855a0316de8bad (patch)
treec9bf36d8973b8ec248430d04b0a64b9b20ffb99f /test/symbolic/klee/viml_expressions_parser.c
parentfe81380bf5d4d161187998088aa9cff948b7c891 (diff)
downloadrneovim-ed253b5fe6515840fe6dd9df83855a0316de8bad.tar.gz
rneovim-ed253b5fe6515840fe6dd9df83855a0316de8bad.tar.bz2
rneovim-ed253b5fe6515840fe6dd9df83855a0316de8bad.zip
klee: Include colors in test
Diffstat (limited to 'test/symbolic/klee/viml_expressions_parser.c')
-rw-r--r--test/symbolic/klee/viml_expressions_parser.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/symbolic/klee/viml_expressions_parser.c b/test/symbolic/klee/viml_expressions_parser.c
index ed280adb22..8f015ae9a7 100644
--- a/test/symbolic/klee/viml_expressions_parser.c
+++ b/test/symbolic/klee/viml_expressions_parser.c
@@ -75,6 +75,9 @@ int main(const int argc, const char *const *const argv,
#endif
ParserLine *cur_pline = &plines[0];
+ ParserHighlight colors;
+ kvi_init(colors);
+
ParserState pstate = {
.reader = {
.get_line = simple_get_line,
@@ -83,13 +86,18 @@ int main(const int argc, const char *const *const argv,
.conv.vc_type = CONV_NONE,
},
.pos = { 0, 0 },
- .colors = NULL,
+ .colors = &colors,
.can_continuate = false,
};
kvi_init(pstate.reader.lines);
const ExprAST ast = viml_pexpr_parse(&pstate, flags);
assert(ast.root != NULL || ast.err.msg);
+ // Can’t possibly have more highlight tokens then there are bytes in string.
+ assert(kv_size(colors) <= INPUT_SIZE - shift);
+ kvi_destroy(colors);
+ // Not destroying pstate.reader.lines because there is no way it could exceed
+ // its limits in the current circumstances.
viml_pexpr_free_ast(ast);
assert(allocated_memory == 0);
}