Add mnemonic mute controls
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package uiterm
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestPrintableKeyTextRoundTrip(t *testing.T) {
|
||||
encoded, err := KeyM.MarshalText()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if string(encoded) != "m" {
|
||||
t.Fatalf("encoded key = %q, want m", encoded)
|
||||
}
|
||||
|
||||
var decoded Key
|
||||
if err := decoded.UnmarshalText([]byte("M")); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if decoded != KeyM {
|
||||
t.Fatalf("decoded key = %v, want %v", decoded, KeyM)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNamedKeyTextStillRoundTrips(t *testing.T) {
|
||||
encoded, err := KeyCtrlT.MarshalText()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var decoded Key
|
||||
if err := decoded.UnmarshalText(encoded); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if decoded != KeyCtrlT {
|
||||
t.Fatalf("decoded key = %v, want %v", decoded, KeyCtrlT)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user