Skip to content
Myr

match-mode-fzf.fish

This file

Path

test/match-mode-fzf.fish

36 lines 路 1.3 KiB

Last changed by

馃悰 Fix sort order regression from 1.14.0Mark Stosbergbefore adoptionf6772e4

History of this file

Take it

1#!/usr/bin/fish23set got45# Given lines of input as $input and a search string as $search,6# run Fuzzel and set the returned string in $got7function test_fzf_mode --argument-names input search8    rm -f out.txt910    echo -e "$input" \11        | $FUZZEL_TEST_BIN --dmenu --match-mode=fzf --search "$search" >out.txt &12    # Wait for fuzzel to launch13    sleep .114    wtype -k Return15    # wait for fuzzel to exit16    sleep .117    set got (cat out.txt)18end1920test_fzf_mode "hamburger\nflag: bulgaria\nbug\njunk\ntrunk" bug21@test "exact matches should rank higher than fuzzy matches" $got = bug2223test_fzf_mode "Checks color contrast between text and background: https://snook.ca/technical/colour_contrast/colour.html\nhttps://chatgpt.com\n" chatgpt24@test "longer contiguous match should rank higher (chatgpt)" $got = 'https://chatgpt.com'2526test_fzf_mode "OpenJDK 21 for x86_64\nFirefox\n" fox27@test "longer contiguous match should rank higher (firefox)" $got = Firefox2829test_fzf_mode "longer entry\nlonger\nlong" long30@test "shorter matches should match first" $got = long3132test_fzf_mode "\nbcdef\nabcd\n" cd33@test "matched sub-string is closer to the beginning is sorted first." $got = bcdef3435test_fzf_mode "\nSteam\nMicrosoft Teams\n" tea36@test "matched sub-string at word boundary is sorted first." $got = 'Microsoft Teams'