summaryrefslogtreecommitdiff
path: root/src/util/util_test.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2024-06-20 23:18:28 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2024-06-22 17:24:47 +0900
commit7c2ffd3fef3f9131ee448a5f40d91835c8bd814d (patch)
tree0cf1df14f976fde619d5084310fa972f07eec21d /src/util/util_test.go
parentdb01e7dab65423cd1d14e15f5b15dfaabe760283 (diff)
downloadfzf-7c2ffd3fef3f9131ee448a5f40d91835c8bd814d.tar.gz
Make transform*, --info-command, and execute-silent cancellable
Users can press CTRL-C after 1 second to terminate the command. Close #3883
Diffstat (limited to 'src/util/util_test.go')
-rw-r--r--src/util/util_test.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/util/util_test.go b/src/util/util_test.go
index 013f3c23..36d71bde 100644
--- a/src/util/util_test.go
+++ b/src/util/util_test.go
@@ -137,8 +137,11 @@ func TestOnce(t *testing.T) {
if o() {
t.Error("Expected: false")
}
- if o() {
- t.Error("Expected: false")
+ if !o() {
+ t.Error("Expected: true")
+ }
+ if !o() {
+ t.Error("Expected: true")
}
o = Once(true)
@@ -148,6 +151,9 @@ func TestOnce(t *testing.T) {
if o() {
t.Error("Expected: false")
}
+ if o() {
+ t.Error("Expected: false")
+ }
}
func TestRunesWidth(t *testing.T) {