Browse code

Test for exact match

John Hawthorn authored on 27/07/2014 04:42:51
Showing 1 changed files

... ...
@@ -62,6 +62,16 @@ int test_positions_2(){
62 62
 	return 0;
63 63
 }
64 64
 
65
+int test_positions_exact(){
66
+	size_t positions[3];
67
+	match_positions("foo", "foo", positions);
68
+	assert(positions[0] == 0);
69
+	assert(positions[1] == 1);
70
+	assert(positions[2] == 2);
71
+
72
+	return 0;
73
+}
74
+
65 75
 void summary(){
66 76
 	printf("%i tests, %i assertions, %i failures\n", testsrun, assertionsrun, testsfailed);
67 77
 }
... ...
@@ -74,6 +84,7 @@ int main(int argc, char *argv[]){
74 84
 	runtest(test_scoring);
75 85
 	runtest(test_positions_1);
76 86
 	runtest(test_positions_2);
87
+	runtest(test_positions_exact);
77 88
 
78 89
 	summary();
79 90