summaryrefslogtreecommitdiffstats
path: root/src/tui/tcell_test.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2024-02-01 18:03:26 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2024-02-01 18:13:00 +0900
commit3c0a6304756e890e0a605b742943a9bb8e1d2247 (patch)
treed834941731002d7a97fead6afe56732c8e454667 /src/tui/tcell_test.go
parent2a1e5a9729eb9c9240d632fb40ac97924f013a45 (diff)
0.46.10.46.1
Diffstat (limited to 'src/tui/tcell_test.go')
-rw-r--r--src/tui/tcell_test.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tui/tcell_test.go b/src/tui/tcell_test.go
index 0d50bb76..0772a9e2 100644
--- a/src/tui/tcell_test.go
+++ b/src/tui/tcell_test.go
@@ -182,6 +182,7 @@ func TestGetCharEventKey(t *testing.T) {
r.Init()
// run and evaluate the tests
+ initialResizeAsInvalid := true
for _, test := range tests {
// generate key event
giveEvent := tcell.NewEventKey(test.giveKey.Type, test.giveKey.Char, test.giveKey.Mods)
@@ -191,8 +192,9 @@ func TestGetCharEventKey(t *testing.T) {
// process the event in fzf and evaluate the test
gotEvent := r.GetChar()
// skip Resize events, those are sometimes put in the buffer outside of this test
- for gotEvent.Type == Resize {
- t.Logf("Resize swallowed")
+ if initialResizeAsInvalid && gotEvent.Type == Invalid {
+ t.Logf("Resize as Invalid swallowed")
+ initialResizeAsInvalid = false
gotEvent = r.GetChar()
}
t.Logf("wantEvent = %T{Type: %v, Char: %q (%[3]v)}\n", test.wantKey, test.wantKey.Type, test.wantKey.Char)