Touch ups and additional capabilities added to fifo functionality. Sample Fenrir scripts in extra
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user