fix: update tests for space input

This commit is contained in:
Christian Rocha 2022-05-10 16:46:19 -04:00
parent d3fb1b707a
commit bfb166822e
1 changed files with 7 additions and 3 deletions

View File

@ -8,8 +8,9 @@ import (
func TestKeyString(t *testing.T) { func TestKeyString(t *testing.T) {
t.Run("alt+space", func(t *testing.T) { t.Run("alt+space", func(t *testing.T) {
if got := KeyMsg(Key{ if got := KeyMsg(Key{
Type: KeySpace, Type: KeyRunes,
Alt: true, Runes: []rune{' '},
Alt: true,
}).String(); got != "alt+ " { }).String(); got != "alt+ " {
t.Fatalf(`expected a "alt+ ", got %q`, got) t.Fatalf(`expected a "alt+ ", got %q`, got)
} }
@ -35,7 +36,10 @@ func TestKeyString(t *testing.T) {
func TestKeyTypeString(t *testing.T) { func TestKeyTypeString(t *testing.T) {
t.Run("space", func(t *testing.T) { t.Run("space", func(t *testing.T) {
if got := KeySpace.String(); got != " " { if got := KeyMsg(Key{
Type: KeyRunes,
Runes: []rune{' '},
}).String(); got != " " {
t.Fatalf(`expected a " ", got %q`, got) t.Fatalf(`expected a " ", got %q`, got)
} }
}) })