summaryrefslogtreecommitdiff
path: root/test/lspfixture
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-29 00:13:08 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:07 -0300
commit841038666a45b40107ee26d1f8e54ed19d0891a0 (patch)
tree3cc4fb3b562d3fa8422f9ffe754e87c75a555862 /test/lspfixture
parentf43c1e11b44e2464f0bb0b635e0abcaf3c717e23 (diff)
downloadpardes-841038666a45b40107ee26d1f8e54ed19d0891a0.tar.gz
pardes-841038666a45b40107ee26d1f8e54ed19d0891a0.zip
lspbench: probe diagnostics and format against a BROKEN fixture
Plus docs/lsp-evaluation.md: the three backends measured head to head.
Diffstat (limited to 'test/lspfixture')
-rw-r--r--test/lspfixture/broken.zig25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/lspfixture/broken.zig b/test/lspfixture/broken.zig
new file mode 100644
index 00000000..22c86c9b
--- /dev/null
+++ b/test/lspfixture/broken.zig
@@ -0,0 +1,25 @@
+//! A deliberately defective file, for the lspbench diagnostics and format
+//! probes. It is NOT built and NOT imported by anything — `zig build` never
+//! sees it, and the snapshot corpus never opens it.
+//!
+//! Why it exists: on a clean, already-formatted corpus the CORRECT answer to
+//! "what is wrong with this file" is nothing, which the harness cannot tell
+//! apart from a backend that has no diagnostics at all. That blind spot
+//! rewards a backend for emitting a filler row and punishes one for being
+//! honest, so the probes point here instead, where there is something real to
+//! find:
+//!
+//! - `unused_local` is a SEMANTIC error. A tokenizer cannot see it; it takes
+//! a compiler front end (AstGen/ZIR, or `zig ast-check`).
+//! - the spacing in `badly_spaced` is a FORMATTING difference, which only a
+//! formatter reports.
+//!
+//! Keep both. Removing either silently turns a probe back into a blind one.
+pub fn hasUnusedLocal() u32 {
+ const unused_local = 41;
+ return 7;
+}
+
+pub fn badly_spaced ( a : u32 , b : u32 ) u32 {
+ return a+b;
+}