Skip to content

Commit c6c53e9

Browse files
committed
tests: internal: slist: test max_split option
Signed-off-by: Eduardo Silva <[email protected]>
1 parent 399b9f7 commit c6c53e9

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

tests/internal/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ set(UNIT_TESTS_FILES
2121

2222
if(FLB_PARSER)
2323
set(UNIT_TESTS_FILES
24-
${UNIT_TESTS_FILTES}
24+
${UNIT_TESTS_FILES}
2525
parser.c
2626
)
2727
endif()

tests/internal/slist.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void test_slist_split_tokens()
138138
"don't escape insi\\\"de q\\\"uoted strings\\\"";
139139

140140
mk_list_init(&list);
141-
flb_slist_split_tokens(&list, txt);
141+
flb_slist_split_tokens(&list, txt, -1);
142142

143143
token_check(&list, 0, "this");
144144
token_check(&list, 1, "is a tokens parser");
@@ -153,6 +153,17 @@ void test_slist_split_tokens()
153153
token_check(&list, 10, "strings\\\"");
154154

155155
flb_slist_destroy(&list);
156+
157+
mk_list_init(&list);
158+
flb_slist_split_string(&list, "aaa bbb ccc ddd eee", ' ', 3);
159+
token_check(&list, 3, "ddd eee");
160+
flb_slist_destroy(&list);
161+
162+
mk_list_init(&list);
163+
flb_slist_split_tokens(&list, "aaa bbb ccc ddd eee", 3);
164+
token_check(&list, 3, "ddd eee");
165+
flb_slist_destroy(&list);
166+
156167
}
157168

158169
void test_bugs()

0 commit comments

Comments
 (0)