diff options
| author | Paul Buetow <paul@buetow.org> | 2025-09-07 14:29:35 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-09-07 14:29:35 +0300 |
| commit | 23482b5d8da5c67da1fc501ddbafdd123be3972c (patch) | |
| tree | 452dc7c418055ebb79a88a303e50d2dbc1877f09 /internal/hexaiaction/cmdentry_test.go | |
| parent | 76f388f9759cdc15cb1eba985cd87cde1906208b (diff) | |
feat: rename hexai-action -> hexai-tmux-action; remove --tmux/--no-tmux; tmux-only flow; update docs and Magefile
Diffstat (limited to 'internal/hexaiaction/cmdentry_test.go')
| -rw-r--r-- | internal/hexaiaction/cmdentry_test.go | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/internal/hexaiaction/cmdentry_test.go b/internal/hexaiaction/cmdentry_test.go index 8525f7d..de8b5dd 100644 --- a/internal/hexaiaction/cmdentry_test.go +++ b/internal/hexaiaction/cmdentry_test.go @@ -13,24 +13,7 @@ import ( "codeberg.org/snonux/hexai/internal/tmux" ) -func TestShouldRunInTmux_Preferences(t *testing.T) { - if shouldRunInTmux(false, true) { t.Fatal("expected false when no-tmux is set") } - if !shouldRunInTmux(true, false) { t.Fatal("expected true when -tmux is set") } -} - -func TestShouldRunInTmux_Auto(t *testing.T) { - oldIsTTY := isTTYFn - oldAvail := tmuxAvailableFn - t.Cleanup(func() { isTTYFn = oldIsTTY; tmuxAvailableFn = oldAvail }) - isTTYFn = func(_ uintptr) bool { return false } - tmuxAvailableFn = func() bool { return true } - if !shouldRunInTmux(false, false) { t.Fatal("expected true when not TTY and tmux available") } - isTTYFn = func(_ uintptr) bool { return true } - if shouldRunInTmux(false, false) { t.Fatal("expected false when TTY present") } - isTTYFn = func(_ uintptr) bool { return false } - tmuxAvailableFn = func() bool { return false } - if shouldRunInTmux(false, false) { t.Fatal("expected false when tmux unavailable") } -} +// tmux-only flow: decision helpers removed. func TestPersistStdin_WritesFile(t *testing.T) { dir := t.TempDir() @@ -78,7 +61,7 @@ func TestRunInTmuxParent_Stubbed(t *testing.T) { rout, wout, _ := os.Pipe() oldExec := osExecutableFn oldSplit := splitRunFn - osExecutableFn = func() (string, error) { return "/bin/hexai-action", nil } + osExecutableFn = func() (string, error) { return "/bin/hexai-tmux-action", nil } splitRunFn = func(opts tmux.SplitOpts, argv []string) error { for i := 0; i < len(argv)-1; i++ { if argv[i] == "-outfile" && i+1 < len(argv) { @@ -106,7 +89,7 @@ func TestRunInTmuxParent_ExecutableError(t *testing.T) { func TestRunInTmuxParent_SplitError(t *testing.T) { oldExec := osExecutableFn - osExecutableFn = func() (string, error) { return "/bin/hexai-action", nil } + osExecutableFn = func() (string, error) { return "/bin/hexai-tmux-action", nil } oldSplit := splitRunFn splitRunFn = func(_ tmux.SplitOpts, _ []string) error { return fmt.Errorf("split failed") } t.Cleanup(func() { osExecutableFn = oldExec; splitRunFn = oldSplit }) |
