Add mnemonic mute controls

This commit is contained in:
Storm Dragon
2026-09-05 00:57:37 -04:00
parent ef19a558d2
commit 97fcde7e96
13 changed files with 232 additions and 17 deletions
+35
View File
@@ -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)
}
}