fzy

terminal fuzzy finder picker

git clone https://9o.is/git/fzy.git

commit 34c15394333dce229eddca2757c72e2d2cc1e0be
parent 1b6427479f1688189c346c7a8d1dfe66648b1fba
Author: John Hawthorn <john.hawthorn@gmail.com>
Date:   Sat, 26 Jul 2014 20:09:07 -0700

Add another test and some comments

Diffstat:
Mfzytest.c | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/fzytest.c b/fzytest.c @@ -24,7 +24,11 @@ TEST(match){ }ENDTEST TEST(scoring){ + /* App/Models/Order is better than App/MOdels/foo */ assert(match("amo", "app/models/foo") < match("amo", "app/models/order")); + + /* App/MOdels/foo is better than App/M/fOo */ + assert(match("amo", "app/m/foo") < match("amo", "app/models/foo")); }ENDTEST TEST(positions_1){ @@ -36,6 +40,10 @@ TEST(positions_1){ }ENDTEST TEST(positions_2){ + /* + * We should prefer matching the 'o' in order, since it's the beginning + * of a word. + */ size_t positions[3]; match_positions("amo", "app/models/order", positions); assert(positions[0] == 0);