fzy
terminal fuzzy finder picker
git clone https://9o.is/git/fzy.git
commit c678f8e41355a29c728dd30a4a569924e9e211e5 parent b2d15ced24ca0dfe2d9c6417c4dc749229153fd3 Author: John Hawthorn <john.hawthorn@gmail.com> Date: Sat, 26 Jul 2014 19:57:57 -0700 test on match_positions Diffstat:
| M | fzytest.c | | | 20 | +++++++++++++++++++- |
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/fzytest.c b/fzytest.c @@ -24,7 +24,23 @@ TEST(match){ }ENDTEST TEST(scoring){ - assert(match("amo", "app/models/foo") < match("amo", "app/models/order")); + assert(match("amo", "app/models/foo") < match("amo", "app/models/order")); +}ENDTEST + +TEST(positions_1){ + size_t positions[3]; + match_positions("amo", "app/models/foo", positions); + assert(positions[0] == 0); + assert(positions[1] == 4); + assert(positions[2] == 5); +}ENDTEST + +TEST(positions_2){ + size_t positions[3]; + match_positions("amo", "app/models/order", positions); + assert(positions[0] == 0); + assert(positions[1] == 4); + assert(positions[2] == 11); }ENDTEST void summary(){ @@ -36,6 +52,8 @@ int main(int argc, char *argv[]){ (void) argv; test_match(); test_scoring(); + test_positions_1(); + test_positions_2(); summary();