Rewrite parse_str interface to be more like strol

This commit is contained in:
Patrick Pelissier committed 2018-05-03 12:59:10 +02:00
1 parent b1597f6f61
commit 2ad8ae3451
2 files changed
+18 -14

No files matched your search

+2 -2
View File
@@ -289,11 +289,11 @@ static void test0(void)
assert (string_cmp_str (s2, "\"Hello world\"\"Hello \\\"world\\\"\"") == 0);
const char *sp = string_get_cstr(s2);
b = string_parse_str(s1, &sp);
b = string_parse_str(s1, sp, &sp);
assert (b == true);
assert (strcmp(sp, "\"Hello \\\"world\\\"\"") == 0);
assert (string_cmp_str(s1, "Hello world") == 0);
b = string_parse_str(s1, &sp);
b = string_parse_str(s1, sp, &sp);
assert (b == true);
assert (strcmp(sp, "") == 0);
assert (string_cmp_str(s1, "Hello \"world\"") == 0);