From: Adam Dickmeiss Date: Wed, 28 Sep 2011 08:41:35 +0000 (+0200) Subject: test nmem_strsplit_escape2 X-Git-Tag: v4.2.17~3 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=794c0656c852e13d5c9b2fdc046309d83caf6916;p=yaz-moved-to-github.git test nmem_strsplit_escape2 --- diff --git a/test/test_nmem.c b/test/test_nmem.c index 1fac283..4dd7769 100644 --- a/test/test_nmem.c +++ b/test/test_nmem.c @@ -102,11 +102,19 @@ void tst_nmem_strsplit(void) YAZ_CHECK(num > 1 && !strcmp(array[1], "b,")); YAZ_CHECK(num > 2 && !strcmp(array[2], "cd")); - nmem_strsplit_escape(nmem, ",", "\\,a,b\\,\\,c\\\\\\|d", &array, &num, 0, '\\'); + nmem_strsplit_escape2(nmem, ",", "\\,a,b\\,\\,c\\\\\\|d", + &array, &num, 0, '\\', 1); YAZ_CHECK(num == 2); YAZ_CHECK(num > 0 && !strcmp(array[0], ",a")); YAZ_CHECK(num > 1 && !strcmp(array[1], "b,,c\\|d")); + + nmem_strsplit_escape2(nmem, ",", "\\,a,b\\,\\,c\\\\\\|d", + &array, &num, 0, '\\', 0); + YAZ_CHECK(num == 2); + YAZ_CHECK(num > 0 && !strcmp(array[0], "\\,a")); + YAZ_CHECK(num > 1 && !strcmp(array[1], "b\\,\\,c\\\\\\|d")); + nmem_destroy(nmem); }