[or-cvs] More tests for split

Nick Mathewson nickm at seul.org
Sun Nov 7 22:58:18 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv1806/src/or

Modified Files:
	test.c 
Log Message:
More tests for split

Index: test.c
===================================================================
RCS file: /home/or/cvsroot/src/or/test.c,v
retrieving revision 1.142
retrieving revision 1.143
diff -u -d -r1.142 -r1.143
--- test.c	7 Nov 2004 01:33:06 -0000	1.142
+++ test.c	7 Nov 2004 22:58:16 -0000	1.143
@@ -617,7 +617,14 @@
   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");



More information about the tor-commits mailing list