1 /*******************************/
2 /* GENERATED FILE, DO NOT EDIT */
3 /*******************************/
7 /*******************************/
8 /* GENERATED FILE, DO NOT EDIT */
9 /*******************************/
12 #define mytest(name, input, expected) \
13 xbt_test_add0(name); \
14 d=xbt_str_split_quoted(input); \
15 s=xbt_str_join(d,"XXX"); \
16 xbt_test_assert3(!strcmp(s,expected),\
17 "Input (%s) leads to (%s) instead of (%s)", \
22 XBT_TEST_UNIT("xbt_str_split_quoted",test_split_quoted, "test the function xbt_str_split_quoted") {
26 mytest("Empty", "", "");
27 mytest("Basic test", "toto tutu", "totoXXXtutu");
28 mytest("Useless backslashes", "\\t\\o\\t\\o \\t\\u\\t\\u", "totoXXXtutu");
29 mytest("Protected space", "toto\\ tutu", "toto tutu");
30 mytest("Several spaces", "toto tutu", "totoXXXtutu");
31 mytest("LTriming", " toto tatu", "totoXXXtatu");
32 mytest("Triming", " toto tutu ", "totoXXXtutu");
33 mytest("Single quotes", "'toto tutu' tata", "toto tutuXXXtata");
34 mytest("Double quotes", "\"toto tutu\" tata", "toto tutuXXXtata");
35 mytest("Mixed quotes", "\"toto' 'tutu\" tata", "toto' 'tutuXXXtata");
36 mytest("Backslashed quotes", "\\'toto tutu\\' tata", "'totoXXXtutu'XXXtata");
37 mytest("Backslashed quotes + quotes", "'toto \\'tutu' tata", "toto 'tutuXXXtata");
40 /*******************************/
41 /* GENERATED FILE, DO NOT EDIT */
42 /*******************************/