fzf

The atago project wrote these specs on its own initiative and runs them in its own CI, to exercise atago against a real program. They are not fzf’s official test suite, and the fzf project is not affiliated with atago.

Summary #

1 suite · 8 scenarios

Contents #

fzf (third-party CLI, pty testbed) #

Source: test/e2e/thirdparty/fzf/fzf.atago.yaml

Scenario: version prints a semantic version #

only when fzf --version succeeds

When #

fzf --version

Then #

  • exit code is 0
  • stdout matches /^[0-9]+\.[0-9]+/

Scenario: filter mode matches fuzzily on stdin without a terminal #

only when fzf --version succeeds

Inputs #

stdin for fzf:

apple
banana
cherry

When #

fzf --filter=bna

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: filter mode exits 1 when nothing matches #

only when fzf --version succeeds

Inputs #

stdin for fzf:

apple
banana
cherry

When #

fzf --filter=zzz

Then #

  • exit code is 1
  • stdout is empty

Scenario: interactive mode refuses to start without a terminal #

only when env CI is set

When #

printf 'apple\n' | fzf

Then #

  • exit code is 2
  • stderr contains ioctl

Scenario: interactive selection picks the queried line #

only when fzf --version succeeds · skipped on Windows

When #

# interactive (pty): printf 'apple\nbanana\ncherry\n' | fzf > pick.txt

Then #

  • exit code is 0
  • file pick.txt contains cherry
  • file pick.txt is checked

Scenario: multi-select accepts several lines at once #

only when fzf --version succeeds · skipped on Windows

When #

# interactive (pty): printf 'apple\nbanana\ncherry\n' | fzf -m --bind ctrl-a:select-all > pick.txt

Then #

  • exit code is 0
  • file pick.txt contains apple, banana, cherry

Scenario: aborting the finder exits 130 #

only when fzf --version succeeds · skipped on Windows

When #

# interactive (pty): printf 'apple\nbanana\ncherry\n' | fzf

Then #

  • exit code is 130

Scenario: the finder screen narrows to the typed query #

only when fzf --version succeeds · skipped on Windows

When #

# interactive (pty): printf 'apple\nbanana\ncherry\n' | fzf

Then #

  • rendered screen contains banana
  • rendered screen does not contain cherry