Browse code

Additional test for position

John Hawthorn authored on 08/12/2015 04:34:23
Showing 1 changed files

... ...
@@ -100,6 +100,15 @@ void test_positions_4() {
100 100
 	assert(positions[1] == 7);
101 101
 }
102 102
 
103
+void test_positions_5() {
104
+	size_t positions[3];
105
+	match_positions("abc", "a a b c c", positions);
106
+	assert(positions[0] == 2);
107
+	assert(positions[1] == 4);
108
+	assert(positions[2] == 6);
109
+}
110
+
111
+
103 112
 void test_positions_exact() {
104 113
 	size_t positions[3];
105 114
 	match_positions("foo", "foo", positions);
... ...
@@ -242,6 +251,7 @@ int main(int argc, char *argv[]) {
242 251
 	runtest(test_positions_2);
243 252
 	runtest(test_positions_3);
244 253
 	runtest(test_positions_4);
254
+	runtest(test_positions_5);
245 255
 	runtest(test_positions_exact);
246 256
 
247 257
 	runtest(test_choices_empty);