Testing strategy
Core logic is tested without a GUI, a network or installed language servers. CI runs every suite on Linux.
| Area | Where | What it proves |
|---|---|---|
| Edits, undo/redo, dirty state, revisions | ide-text unit tests | Transactions, coalescing, undo to saved state is clean, invalid edits change nothing |
| Unicode and coordinates | ide-text position, document tests | Char/byte/UTF-16 conversions with multibyte text, clamping, empty files |
| Line endings, BOM, binary, size | ide-text document tests | Round-trips and clear refusals |
| Language detection, syntax | ide-languages unit tests | Detection, grammar compatibility, incremental parse equals full parse, budgeted parse keeps the old tree |
| Language-service lifecycle | ide-languages/tests/lsp_lifecycle.rs | Lazy start, sharing, grace-period reuse, eviction, missing server, crash restart and give-up, shutdown |
| Extensions | ide-extensions tests | Manifest validation, compatibility, discovery, enable/disable, qualified contributions |
| Configuration, trust, profiles, themes | ide-core unit tests | Defaults, invalid files, persistence, overrides |
| Workspace and files | ide-core unit tests | Lazy listing, exclusions, symlink cycles, permissions, atomic saves preserving links and modes |
| End-to-end session | ide-core/tests/session.rs | Trust gating, shared server, diagnostics and definition through the fake server, conflict handling, extension contributions, profiles, large files |
| AI boundary | ide-ai tests | Preview equals what is sent, cancellation, failures, real HTTP/SSE parsing against a local test server |
Conventions
- Use
tempfiledirectories and the fake language server; never the developer's home directory or the network. - Waiting on asynchronous results uses polling with a deadline, never a fixed sleep that the test depends on.
- A bug fix starts with a failing test when practical.
- Do not weaken an assertion or mark a test
#[ignore]to make CI pass.#[ignore]is reserved for opt-in tests that need external tools, with the reason in the attribute. - Performance is measured with benchmarks, not asserted in unit tests.
The desktop UI has no automated tests yet. Changes to it are verified manually (screenshots under Xvfb are fine) and described in the pull request; a UI test harness is on the backlog.