diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-11-07 22:58:16 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-11-07 22:58:16 +0000 |
commit | 0059ee5feaca42d5675957bdbaa467f6b7dd5bc0 (patch) | |
tree | 9c16cb466f5d184934ebbafa700adce129db7179 /src | |
parent | dac5d6715e92ee37ee782d48b974147eed48f2ab (diff) | |
download | tor-0059ee5feaca42d5675957bdbaa467f6b7dd5bc0.tar.gz tor-0059ee5feaca42d5675957bdbaa467f6b7dd5bc0.zip |
More tests for split
svn:r2705
Diffstat (limited to 'src')
-rw-r--r-- | src/or/test.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/or/test.c b/src/or/test.c index 7138bb1c94..a8d9f63cc7 100644 --- a/src/or/test.c +++ b/src/or/test.c @@ -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"); |