Skip to content
Myr

test: Add more test coverage for --auto-select plus --search in dmenu mode.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Mark Stosberg · committed by Daniel Eklöf · parent c751abd · Browse files · 1 file+36 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+36 added−0 removed

  • tests:+36 added−0 removed

1 file+36 added−0 removed

modified:test/auto-select.fish+36 added
53 unmodified lines
54end5556test_normal_mode unique uniqu57@test "normal mode should not auto-select even with one match" "$got" = ""5859# Test --auto-select with --search option60function test_auto_select_with_search --argument-names input search61 rm -f out.txt6263 echo -e "$input" \64 | $FUZZEL_TEST_BIN --dmenu --auto-select --search "$search" >out.txt &65 # Wait for fuzzel to auto-select and exit66 sleep .367 set got (cat out.txt)68end6970# Test that auto-select works with --search when only one match remains71test_auto_select_with_search "application\napple\nbanana" "applic"72@test "auto-select with --search should work when only one match remains" "$got" = "application"7374# Test that auto-select works with --search for exact matches75test_auto_select_with_search "calculator\ncalendar\ncamera" "calculator"76@test "auto-select with --search should work for exact matches" "$got" = "calculator"7778# Test that auto-select with --search doesn't trigger with multiple matches79function test_auto_select_with_search_multiple --argument-names input search80 rm -f out.txt8182 echo -e "$input" \83 | $FUZZEL_TEST_BIN --dmenu --auto-select --search "$search" >out.txt &84 # Wait briefly to see if fuzzel auto-selects (it shouldn't)85 sleep .186 # Force exit with Escape87 wtype -k Escape88 sleep .189 set got (cat out.txt)90end9192test_auto_select_with_search_multiple "apple\napricot\nbanana" "ap"93@test "auto-select with --search should not trigger with multiple matches" "$got" = ""