aboutsummaryrefslogtreecommitdiff
path: root/tests/tmux-util/fake-fzf
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tmux-util/fake-fzf')
-rwxr-xr-xtests/tmux-util/fake-fzf30
1 files changed, 0 insertions, 30 deletions
diff --git a/tests/tmux-util/fake-fzf b/tests/tmux-util/fake-fzf
deleted file mode 100755
index 476bf7f..0000000
--- a/tests/tmux-util/fake-fzf
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-# Fake fzf for testing tmux-util.
-#
-# Control via env vars:
-# FAKE_FZF_CHOICE_LINE — 1-based line index into stdin; that line is
-# printed as the selection and exit 0.
-# FAKE_FZF_CHOICE — print this literal string as the selection and
-# exit 0 (ignored if FAKE_FZF_CHOICE_LINE is set).
-# (neither set) — exit 130 (user cancelled).
-#
-# Every invocation is logged to $FAKE_TMUX_DIR/calls.log as one line.
-
-: "${FAKE_TMUX_DIR:?FAKE_TMUX_DIR must be set}"
-printf 'fzf %s\n' "$*" >> "$FAKE_TMUX_DIR/calls.log"
-
-if [ -n "${FAKE_FZF_CHOICE_LINE:-}" ]; then
- awk -v n="$FAKE_FZF_CHOICE_LINE" 'NR == n { print; exit }'
- exit 0
-fi
-
-if [ -n "${FAKE_FZF_CHOICE:-}" ]; then
- # Drain stdin so the pipe upstream doesn't SIGPIPE
- cat >/dev/null
- printf '%s\n' "$FAKE_FZF_CHOICE"
- exit 0
-fi
-
-# Cancelled
-cat >/dev/null
-exit 130