match-nth.fish
This file
Path
test/match-nth.fish
22 lines · 897 bytes
Last changed by
test: add test for --match-nthDaniel Eklöfbefore adoptionda0c1eb
History of this fileTake it
test: add test for --match-nthDaniel Eklöfbefore adoptionda0c1eb
lines 1–22why, one step back1#!/usr/bin/fish23set got45function test_match_nth --argument-names input search with_nth_format match_nth_format6 set got (echo -e "$input" |7 $FUZZEL_TEST_BIN --dmenu \8 --search="$search" \9 --auto-select \10 --nth-delim ' ' \11 --with-nth="$with_nth_format" \12 --match-nth="$match_nth_format")13end1415test_match_nth "apple banana cherry" "banana" "{1}" "{2}"16@test "--match-nth with valid formatters" "$got" = "apple banana cherry"1718test_match_nth "apple banana cherry\nbanana apple cherry" "apple" "{1}" "{2}"19@test "--match-nth with valid formatters" "$got" = "banana apple cherry"2021test_match_nth "apple banana cherry" "cherry" "{1}" "{2..3}"22@test "--match-nth with index range" "$got" = "apple banana cherry"