More work on LibreOffice support.

This commit is contained in:
Storm Dragon committed 2026-10-15 00:50:49 -04:00
1 parent e0c8c6198c
commit 4ac59d4ced
25 files changed
+392 -57

No files matched your search

+32
View File
@@ -28,6 +28,38 @@ import (
"git.stormux.org/storm/cthulhu/internal/input"
)
func TestCommandRuntimeRoutesFocusPresentationRequests(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
commands := &fakeCommands{commands: make(chan input.CommandEvent, 1)}
requests := make(chan input.Command, 1)
worker := commandRuntime{logger: slog.New(slog.DiscardHandler), commands: commands,
reviewRequests: requests, stopRun: cancel}
done := make(chan error, 1)
go func() { done <- worker.run(ctx) }()
defer func() {
cancel()
select {
case err := <-done:
if err != nil {
t.Error(err)
}
case <-time.After(time.Second):
t.Error("command worker did not stop")
}
}()
for _, command := range []input.Command{input.WhereAmI, input.PresentCellFormula} {
commands.commands <- input.CommandEvent{Command: command}
select {
case got := <-requests:
if got != command {
t.Fatalf("focus request = %q, want %q", got, command)
}
case <-time.After(time.Second):
t.Fatalf("missing focus request %q", command)
}
}
}
func TestRunRoutesPreferencesWithoutStoppingCommandHandling(t *testing.T) {
settings := config.DefaultSettings()
settings.EnableSpeech = false