Touch ups and additional capabilities added to fifo functionality. Sample Fenrir scripts in extra

This commit is contained in:
Storm Dragon
2026-09-06 17:55:21 -04:00
parent 4ef8553c7d
commit 6817ecd90b
7 changed files with 75 additions and 37 deletions
+18
View File
@@ -43,3 +43,21 @@ func TestSafeRuneRemovesTerminalControlCharacters(t *testing.T) {
t.Fatalf("safeRune altered printable text: %U", got)
}
}
func TestDispatchCommandReportsMatchesAndPreservesArguments(t *testing.T) {
ui := New(nil)
got := ""
ui.AddCommandListener(func(_ *Ui, command string) {
got = command
}, "record")
if !ui.DispatchCommand("record start") {
t.Fatal("registered command was not handled")
}
if got != "start" {
t.Fatalf("command argument = %q, want start", got)
}
if ui.DispatchCommand("unknown") {
t.Fatal("unknown command was reported as handled")
}
}