summaryrefslogtreecommitdiff
path: root/internal/hexaiaction/prompts_more_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/hexaiaction/prompts_more_test.go')
-rw-r--r--internal/hexaiaction/prompts_more_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/internal/hexaiaction/prompts_more_test.go b/internal/hexaiaction/prompts_more_test.go
new file mode 100644
index 0000000..62abc97
--- /dev/null
+++ b/internal/hexaiaction/prompts_more_test.go
@@ -0,0 +1,19 @@
+package hexaiaction
+
+import (
+ "context"
+ "strings"
+ "testing"
+
+ "codeberg.org/snonux/hexai/internal/llm"
+)
+
+type simpleDoer struct{ s string }
+
+func (d simpleDoer) Chat(_ context.Context, _ []llm.Message, _ ...llm.RequestOption) (string, error) { return d.s, nil }
+
+func TestRunOnce_StripsFences(t *testing.T) {
+ got, err := runOnce(context.Background(), simpleDoer{"```\nok\n```"}, "SYS", "USER")
+ if err != nil { t.Fatalf("runOnce: %v", err) }
+ if strings.TrimSpace(got) != "ok" { t.Fatalf("got %q", got) }
+}