From bf53cf2a673af254d7a08bc3b2ab815a08f66117 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 4 Sep 2025 16:04:58 +0300 Subject: tests: add shared test fixtures, expand provider breadth (multi-choice, error bodies), add LSP rewrite/diagnostics realism and table-driven tests --- internal/testutil/fixtures.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 internal/testutil/fixtures.go (limited to 'internal/testutil/fixtures.go') diff --git a/internal/testutil/fixtures.go b/internal/testutil/fixtures.go new file mode 100644 index 0000000..41993d3 --- /dev/null +++ b/internal/testutil/fixtures.go @@ -0,0 +1,27 @@ +package testutil + +// MultilineDocBlock returns a realistic multi-line documentation block. +func MultilineDocBlock() string { + return "// add adds two numbers\n// returns their sum" +} + +// MultilineChatReply returns a multi-line assistant reply for chat tests. +func MultilineChatReply() string { + return "Hello, world!\nThis is a multi-line reply." +} + +// MultilineFunctionSuggestion returns a more realistic multi-line function body suggestion. +func MultilineFunctionSuggestion() string { + return "(ctx context.Context, input string) (*CustData, error) {\n // TODO: implement\n return &CustData{}, nil\n}" +} + +// MarkdownCodeFence returns a fenced markdown snippet used in post-processing tests. +func MarkdownCodeFence() string { + return "```go\nname := value\n```" +} + +// MalformedJSON returns a deliberately malformed JSON string. +func MalformedJSON() string { + return "{\"choices\":[{\"delta\":{\"content\":\"oops\"}}]" +} + -- cgit v1.2.3