From b2f558c26c246bbe89aa0662855274c1c2e68230 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Wed, 14 Oct 2026 01:22:04 -0400 Subject: [PATCH] Fixed some tests. --- AGENTS.md | 6 ++++++ distro-packages/Arch-Linux/cthulhu-git/PKGBUILD | 2 +- internal/app/date_time_test.go | 14 ++++++++++++++ internal/app/tentacle_interaction_test.go | 12 +++++++++++- 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 5e54cf3..13ce594 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -26,6 +26,8 @@ Read [CONTRIBUTING.md](CONTRIBUTING.md) for detailed safeguards. Compare accepte Fix regressions in the shared subsystem when appropriate. Identify state ownership, lifetime, reset, and cancellation; keep native callbacks and input/focus handling bounded. Preserve Xorg correctness while allowing capability-based Wayland degradation. Keep Tentacles external and responsive. +Prefer core Go implementations for features users expect from the reader itself; use Tentacles for extensions. + Expose GUI controls through accessibility APIs. Keep outer preferences combo widgets `can-focus=False`; verify Tab/Shift+Tab, popup selection, and Apply/reload. Validate versioned TOML settings through persistence and runtime consumption. Protect passwords; redact private debug output before sharing. ## Testing Guidelines @@ -35,3 +37,7 @@ Use Go's `testing` package, `*_test.go`, and `TestBehavior` functions. Start wit ## Commit & Pull Request Guidelines Use short descriptive subjects consistent with history. Confirm the intended target branch; `legacy` preserves Python. Describe behavior, issues, regressions checked, skipped checks, and remaining live acceptance. Human diff review and testing precede submission under the policy in `CONTRIBUTING.md`. + +## Guide Maintenance + +Update this guide when working rules, repository layout, commands, or verification requirements change. Replace stale guidance instead of appending progress reports; keep detailed procedures in `CONTRIBUTING.md`. diff --git a/distro-packages/Arch-Linux/cthulhu-git/PKGBUILD b/distro-packages/Arch-Linux/cthulhu-git/PKGBUILD index f584c20..763c80a 100644 --- a/distro-packages/Arch-Linux/cthulhu-git/PKGBUILD +++ b/distro-packages/Arch-Linux/cthulhu-git/PKGBUILD @@ -4,7 +4,7 @@ pkgbase=cthulhu-git pkgname=cthulhu-git _pkgname=cthulhu -pkgver=2026.10.14.r4.gee4d50c +pkgver=2026.10.14.r5.g6613237 pkgrel=1 pkgdesc="Desktop-agnostic screen reader with speech, Braille, and Tentacle support" url="https://git.stormux.org/storm/cthulhu" diff --git a/internal/app/date_time_test.go b/internal/app/date_time_test.go index 1f5ba07..9422e2b 100644 --- a/internal/app/date_time_test.go +++ b/internal/app/date_time_test.go @@ -3,6 +3,8 @@ package app import ( "context" "log/slog" + "os" + "os/exec" "path/filepath" "testing" "time" @@ -14,6 +16,18 @@ import ( ) func TestDateTimeFormats(t *testing.T) { + // datetime initializes libc's locale before tests run. Use a child process + // so these fixed English expectations do not depend on the build locale. + if os.Getenv("CTHULHU_DATE_TIME_TEST_CHILD") != "1" { + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + command := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestDateTimeFormats$", "-test.count=1") + command.Env = append(os.Environ(), "LC_ALL=C", "CTHULHU_DATE_TIME_TEST_CHILD=1") + if output, err := command.CombinedOutput(); err != nil { + t.Fatalf("C-locale date/time test: %v\n%s", err, output) + } + return + } now := time.Date(2026, 9, 17, 19, 5, 0, 0, time.UTC) for _, tc := range []struct { command input.Command diff --git a/internal/app/tentacle_interaction_test.go b/internal/app/tentacle_interaction_test.go index f8ad2a7..db03ab2 100644 --- a/internal/app/tentacle_interaction_test.go +++ b/internal/app/tentacle_interaction_test.go @@ -79,7 +79,17 @@ func interactiveFixture(t *testing.T, mode string) (*tentacleRuntime, *internalU if err := runtime.Start(ctx); err != nil { t.Fatal(err) } - waitTentacle(t, func() bool { return len(bindings.TentacleBindings()) != 0 }) + waitTentacle(t, func() bool { + published := bindings.TentacleBindings() + if len(published) == 0 { + return false + } + // Native bindings are installed before activation publishes dispatch. + runtime.mutex.Lock() + defer runtime.mutex.Unlock() + _, ready := runtime.commands[published[0].Command] + return ready + }) runtime.Invoke(ctx, bindings.TentacleBindings()[0].Command) return runtime, ui, keys, marker }