diff options
| author | Paul Buetow <paul@buetow.org> | 2025-09-04 16:16:23 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-09-04 16:16:23 +0300 |
| commit | 2a6ff853c20e6c1c780c69affdadacda2db202b6 (patch) | |
| tree | b987323524c026dd86280e28cb9f696fc3fade5b /docs/testing.md | |
| parent | 09b33e65d92f5fb5b907e49c3d27584615cf2b83 (diff) | |
tests: expand negative SSE and table-driven coverage; add docs/testing.md; use shared fixtures
Diffstat (limited to 'docs/testing.md')
| -rw-r--r-- | docs/testing.md | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/testing.md b/docs/testing.md new file mode 100644 index 0000000..eff6f2e --- /dev/null +++ b/docs/testing.md @@ -0,0 +1,16 @@ +# Testing Guide + +This repository includes a growing test suite designed to be realistic and robust. + +Key patterns: + +- Table‑driven tests: consolidate repetitive scenarios into concise tables (see `internal/lsp/*_table_test.go`). +- Shared fixtures: use `internal/testutil/fixtures.go` for multi‑line docblocks, chat replies, function suggestions, and markdown fences. +- Provider mocks: use `httptest.Server` and/or custom `http.RoundTripper` to simulate OpenAI/Copilot/Ollama responses, including success, stream (SSE), and error cases. +- E2E LSP tests: capture JSON‑RPC frames from the in‑memory server (`captureResponse`, `captureRequest`) and validate code actions, resolves, and chat edits. + +Suggested additions: + +- Expand table‑driven coverage for completion edit computations and label/filter selection. +- Add more negative tests (malformed SSE/JSON payloads) to assert robust error handling. + |
