summaryrefslogtreecommitdiff
path: root/internal/hexaiaction
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-09-16 08:39:52 +0300
committerPaul Buetow <paul@buetow.org>2025-09-16 08:39:52 +0300
commit2b6232704ecc90630196b9f829f966533e5cdccd (patch)
tree7d6db2f618faeb590b00e1f45ddf17f47b68beaa /internal/hexaiaction
parentf645911896634752d55fad50d52365c0255bb279 (diff)
release: v0.11.0 – context-aware in-editor chat; respect general.context_mode; stabilize env-dependent testsv0.11.0
Diffstat (limited to 'internal/hexaiaction')
-rw-r--r--internal/hexaiaction/custom_action_test.go2
-rw-r--r--internal/hexaiaction/run_seam_test.go7
2 files changed, 7 insertions, 2 deletions
diff --git a/internal/hexaiaction/custom_action_test.go b/internal/hexaiaction/custom_action_test.go
index 71319f4..4808079 100644
--- a/internal/hexaiaction/custom_action_test.go
+++ b/internal/hexaiaction/custom_action_test.go
@@ -20,6 +20,8 @@ func (llmFake2) Name() string { return "fake" }
func (llmFake2) DefaultModel() string { return "m" }
func TestActionCustom_UsesEditorPrompt(t *testing.T) {
+ // Isolate from user config that might enable custom menu/TUI.
+ t.Setenv("XDG_CONFIG_HOME", t.TempDir())
// Seam: choose custom, fake client, and fake editor
oldChoose := chooseActionFn
oldNew := newClientFromApp
diff --git a/internal/hexaiaction/run_seam_test.go b/internal/hexaiaction/run_seam_test.go
index bbec858..9aa92bf 100644
--- a/internal/hexaiaction/run_seam_test.go
+++ b/internal/hexaiaction/run_seam_test.go
@@ -18,6 +18,8 @@ func (llmFake) Name() string { return "fake" }
func (llmFake) DefaultModel() string { return "model" }
func TestRun_WithSeams_SkipAndRewrite(t *testing.T) {
+ // Isolate from user config to avoid environment-dependent behavior/logging.
+ t.Setenv("XDG_CONFIG_HOME", t.TempDir())
// Seam: choose action to Skip first, then Rewrite
oldChoose := chooseActionFn
oldNew := newClientFromApp
@@ -26,8 +28,9 @@ func TestRun_WithSeams_SkipAndRewrite(t *testing.T) {
chooseActionFn = func() (ActionKind, error) { return ActionSkip, nil }
newClientFromApp = func(_ appconfig.App) (llm.Client, error) { return llmFake{}, nil }
var out bytes.Buffer
+ var errBuf bytes.Buffer
in := bytes.NewBufferString("some code")
- if err := Run(context.Background(), in, &out, &out); err != nil {
+ if err := Run(context.Background(), in, &out, &errBuf); err != nil {
t.Fatalf("Run skip: %v", err)
}
if out.String() != "some code" {
@@ -37,7 +40,7 @@ func TestRun_WithSeams_SkipAndRewrite(t *testing.T) {
chooseActionFn = func() (ActionKind, error) { return ActionRewrite, nil }
out.Reset()
in = bytes.NewBufferString(";upper;\nhello")
- if err := Run(context.Background(), in, &out, &out); err != nil {
+ if err := Run(context.Background(), in, &out, &errBuf); err != nil {
t.Fatalf("Run rewrite: %v", err)
}
if out.String() == "" {