key.To/FromChar

This commit is contained in:
Bel LaPointe
2023-03-02 09:25:19 -07:00
parent 5d30297ec4
commit 5f59054366
10 changed files with 135 additions and 44 deletions

View File

@@ -0,0 +1,21 @@
package key
import "testing"
func TestFromChar(t *testing.T) {
if got := FromChar('a'); got != A {
t.Error(got)
}
if got := FromChar('A'); got != A {
t.Error(got)
}
if got := FromChar('!'); got != Undef {
t.Error(got)
}
if got := ToChar(A); got != 'a' {
t.Error(got)
}
if got := ToChar(-1); got != '?' {
t.Error(got)
}
}