Browse code

test on match_positions

John Hawthorn authored on 27/07/2014 02:57:57
Showing 1 changed files

... ...
@@ -24,7 +24,23 @@ TEST(match){
24 24
 }ENDTEST
25 25
 
26 26
 TEST(scoring){
27
-    assert(match("amo", "app/models/foo") < match("amo", "app/models/order"));
27
+	assert(match("amo", "app/models/foo") < match("amo", "app/models/order"));
28
+}ENDTEST
29
+
30
+TEST(positions_1){
31
+	size_t positions[3];
32
+	match_positions("amo", "app/models/foo", positions);
33
+	assert(positions[0] == 0);
34
+	assert(positions[1] == 4);
35
+	assert(positions[2] == 5);
36
+}ENDTEST
37
+
38
+TEST(positions_2){
39
+	size_t positions[3];
40
+	match_positions("amo", "app/models/order", positions);
41
+	assert(positions[0] == 0);
42
+	assert(positions[1] == 4);
43
+	assert(positions[2] == 11);
28 44
 }ENDTEST
29 45
 
30 46
 void summary(){
... ...
@@ -36,6 +52,8 @@ int main(int argc, char *argv[]){
36 52
 	(void) argv;
37 53
 	test_match();
38 54
 	test_scoring();
55
+	test_positions_1();
56
+	test_positions_2();
39 57
 
40 58
 	summary();
41 59