]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
More tests for split
authorNick Mathewson <nickm@torproject.org>
Sun, 7 Nov 2004 22:58:16 +0000 (22:58 +0000)
committerNick Mathewson <nickm@torproject.org>
Sun, 7 Nov 2004 22:58:16 +0000 (22:58 +0000)
svn:r2705

src/or/test.c

index 7138bb1c942b741853db24194a484e31d0d63f88..a8d9f63cc7d43b88eecc14a41d41d5184e21ab97 100644 (file)
@@ -617,7 +617,14 @@ test_util(void) {
   test_streq("zhasd <>  <> bnud<>", smartlist_get(sl, 4));
   SMARTLIST_FOREACH(sl, char *, cp, tor_free(cp));
   smartlist_clear(sl);
-  
+
+  smartlist_split_string(sl, "abcd\n", "\n", SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0);
+  test_eq(1, smartlist_len(sl));
+  test_streq("abcd", smartlist_get(sl, 0));
+  smartlist_split_string(sl, "efgh", "\n", SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0);
+  test_eq(2, smartlist_len(sl));
+  test_streq("efgh", smartlist_get(sl, 1));
+
 
   /* Test tor_strstrip() */
   strcpy(buf, "Testing 1 2 3");