key.To/FromChar
This commit is contained in:
21
src/device/output/key/char_test.go
Normal file
21
src/device/output/key/char_test.go
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user