Fixed some tests.

This commit is contained in:
Storm Dragon committed 2026-10-14 01:22:04 -04:00
1 parent 6613237233
commit b2f558c26c
4 files changed
+32 -2

No files matched your search

+6
View File
@@ -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`.
@@ -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"
+14
View File
@@ -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
+11 -1
View File
@@ -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
}