156 free(list); |
156 free(list); |
157 |
157 |
158 /* exact match (exm) */ |
158 /* exact match (exm) */ |
159 n = 0; |
159 n = 0; |
160 list = sstrsplit(test, ST("this,is,a,csv,string"), &n); |
160 list = sstrsplit(test, ST("this,is,a,csv,string"), &n); |
161 UCX_TEST_ASSERT(n == 1, "exm, list length must be 1"); |
161 UCX_TEST_ASSERT(n == 0, "exm, list length must be 0"); |
162 UCX_TEST_ASSERT(list[0].length == 0, "exm, single item must be empty"); |
162 UCX_TEST_ASSERT(list == NULL, "exm, list must be NULL"); |
163 UCX_TEST_ASSERT(strcmp(test.ptr, original) == 0, |
|
164 "exm, original has been modified"); |
|
165 free(list); |
163 free(list); |
166 |
164 |
167 /* substring (subs) */ |
165 /* substring (subs) */ |
168 n = 0; |
166 n = 0; |
169 list = sstrsplit(test, ST("this,is,a,csv,string,with,extension"), &n); |
167 list = sstrsplit(test, ST("this,is,a,csv,string,with,extension"), &n); |