fix(keys): spacebar now sends a KeySpace (#289)

* fix: replace keySP with working KeySpace

* test: update test to meet new reqs

* fix: fix test looking for 'space'

* fix(keys): set type to KeySpace when sending a space

* docs(keys): comments

Co-authored-by: Christian Rocha <christian@rocha.is>
This commit is contained in:
bashbunni
2022-04-12 08:14:35 -07:00
committed by GitHub
parent 3795c036c4
commit 14e58aa1f9
2 changed files with 19 additions and 10 deletions

View File

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