Browse code

Add another test and some comments

John Hawthorn authored on 27/07/2014 03:09:07
Showing 1 changed files

... ...
@@ -24,7 +24,11 @@ TEST(match){
24 24
 }ENDTEST
25 25
 
26 26
 TEST(scoring){
27
+	/* App/Models/Order is better than App/MOdels/foo  */
27 28
 	assert(match("amo", "app/models/foo") < match("amo", "app/models/order"));
29
+
30
+	/* App/MOdels/foo is better than App/M/fOo  */
31
+	assert(match("amo", "app/m/foo") < match("amo", "app/models/foo"));
28 32
 }ENDTEST
29 33
 
30 34
 TEST(positions_1){
... ...
@@ -36,6 +40,10 @@ TEST(positions_1){
36 40
 }ENDTEST
37 41
 
38 42
 TEST(positions_2){
43
+	/*
44
+	 * We should prefer matching the 'o' in order, since it's the beginning
45
+	 * of a word.
46
+	 */
39 47
 	size_t positions[3];
40 48
 	match_positions("amo", "app/models/order", positions);
41 49
 	assert(positions[0] == 0);