diff options
| author | Paul Buetow <paul@buetow.org> | 2025-09-04 16:04:58 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-09-04 16:04:58 +0300 |
| commit | bf53cf2a673af254d7a08bc3b2ab815a08f66117 (patch) | |
| tree | 3c29faaaaa6777d9a9346c90bc7cba88978d8477 /internal/testutil/fixtures.go | |
| parent | 448d4b169904cfd6e1f701524539a27d8de18734 (diff) | |
tests: add shared test fixtures, expand provider breadth (multi-choice, error bodies), add LSP rewrite/diagnostics realism and table-driven tests
Diffstat (limited to 'internal/testutil/fixtures.go')
| -rw-r--r-- | internal/testutil/fixtures.go | 27 |
1 files changed, 27 insertions, 0 deletions
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\"}}]" +} + |
