whoops nums bitwised

This commit is contained in:
Bel LaPointe
2023-03-23 16:14:25 -06:00
parent f9ec874491
commit 4f48ee805f
4 changed files with 10 additions and 1 deletions

View File

@@ -57,7 +57,7 @@ func ToChar(k Key) byte {
}
func FromChar(b byte) Key {
if b < 'a' {
if 'A' <= b && b <= 'Z' {
b += 'a' - 'A'
}
v, ok := charToKey[b]

View File

@@ -3,6 +3,9 @@ package key
import "testing"
func TestFromChar(t *testing.T) {
if got := FromChar('1'); got != N1 {
t.Error(got)
}
if got := FromChar('a'); got != A {
t.Error(got)
}