summaryrefslogtreecommitdiff
path: root/src/util/util_test.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2019-12-09 21:32:58 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2019-12-09 21:32:58 +0900
commit2b725a4db5e973d7ce90d1ac0996dcfd3c3f0116 (patch)
treec9eea79293181e3049ac974d3f8cc892bd27bf77 /src/util/util_test.go
parentaf1a5f130bbd2464131ec2ae91c538ace6801a73 (diff)
downloadfzf-2b725a4db5e973d7ce90d1ac0996dcfd3c3f0116.tar.gz
Defer resetting multi-selection on reload
Diffstat (limited to 'src/util/util_test.go')
-rw-r--r--src/util/util_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/util/util_test.go b/src/util/util_test.go
index d6a03d9d..4baa56fb 100644
--- a/src/util/util_test.go
+++ b/src/util/util_test.go
@@ -20,3 +20,21 @@ func TestContrain(t *testing.T) {
t.Error("Expected", 3)
}
}
+
+func TestOnce(t *testing.T) {
+ o := Once(false)
+ if o() {
+ t.Error("Expected: false")
+ }
+ if o() {
+ t.Error("Expected: false")
+ }
+
+ o = Once(true)
+ if !o() {
+ t.Error("Expected: true")
+ }
+ if o() {
+ t.Error("Expected: false")
+ }
+}