summaryrefslogtreecommitdiff
path: root/src/reader_test.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2019-11-10 11:36:22 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2019-11-10 11:43:37 +0900
commit78da9287272a0bfa183498c5b2e9fde10a3663a0 (patch)
tree4318915c919024604777e16d49ae14a838564804 /src/reader_test.go
parent11962dabba69e706246bfcd54fa42b1e1c6bee8b (diff)
downloadfzf-78da9287272a0bfa183498c5b2e9fde10a3663a0.tar.gz
Experimental implementation of "reload" action
# Reload input list with different sources seq 10 | fzf --bind 'ctrl-a:reload(seq 100),ctrl-b:reload(seq 1000)' # Reload as you type seq 10 | fzf --bind 'change:reload:seq {q}' --phony # Integration with ripgrep RG_PREFIX="rg --column --line-number --no-heading --color=always --smart-case " INITIAL_QUERY="" FZF_DEFAULT_COMMAND="$RG_PREFIX '$INITIAL_QUERY'" \ fzf --bind "change:reload:$RG_PREFIX {q} || true" \ --ansi --phony --query "$INITIAL_QUERY" Close #751 Close #965 Close #974 Close #1736 Related #1723
Diffstat (limited to 'src/reader_test.go')
-rw-r--r--src/reader_test.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/reader_test.go b/src/reader_test.go
index c29936ce..b0610688 100644
--- a/src/reader_test.go
+++ b/src/reader_test.go
@@ -12,6 +12,7 @@ func TestReadFromCommand(t *testing.T) {
eb := util.NewEventBox()
reader := Reader{
pusher: func(s []byte) bool { strs = append(strs, string(s)); return true },
+ finChan: make(chan bool, 1),
eventBox: eb,
event: int32(EvtReady)}
@@ -23,7 +24,7 @@ func TestReadFromCommand(t *testing.T) {
}
// Normal command
- reader.fin(reader.readFromCommand("sh", `echo abc && echo def`))
+ reader.fin(reader.readFromCommand(nil, `echo abc && echo def`))
if len(strs) != 2 || strs[0] != "abc" || strs[1] != "def" {
t.Errorf("%s", strs)
}
@@ -48,7 +49,7 @@ func TestReadFromCommand(t *testing.T) {
reader.startEventPoller()
// Failing command
- reader.fin(reader.readFromCommand("sh", `no-such-command`))
+ reader.fin(reader.readFromCommand(nil, `no-such-command`))
strs = []string{}
if len(strs) > 0 {
t.Errorf("%s", strs)