diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-04 23:51:04 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 09:54:56 -0300 |
| commit | c538b2a4db9a7f7d35d7718629caef253fa63ad8 (patch) | |
| tree | afa8ce40dc98fd9e163cfba4b12db24eed0987ae /test/lspbench.zig | |
| parent | 370b428a871b8b9e2d860a242eff8a18da4f5574 (diff) | |
| download | pardes-c538b2a4db9a7f7d35d7718629caef253fa63ad8.tar.gz pardes-c538b2a4db9a7f7d35d7718629caef253fa63ad8.zip | |
build: the perf and fs bench programs' tests, which compile no editor, run with unit-test, and their perf-test and fs-bench-test steps go; lspbench-test and hxdiff-test go, with lspbench's three tests, which only that step ran, and hxdiff's --self-test (hxdiff's own four tests stay: test/panes.zig runs them in pane-test)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/lspbench.zig')
| -rw-r--r-- | test/lspbench.zig | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/test/lspbench.zig b/test/lspbench.zig index 87b6d83e..9857b61c 100644 --- a/test/lspbench.zig +++ b/test/lspbench.zig @@ -89,27 +89,6 @@ const Options = struct { } }; -test "lspbench options reject unknown flags and multiple roots before probing" { - const defaults = try Options.parse(&.{}); - try std.testing.expect(!defaults.json and !defaults.check); - try std.testing.expectEqualStrings(".", defaults.root); - for ([_][]const []const u8{ - &.{ "--json", "repo root", "--check" }, - &.{ "repo root", "--check", "--json" }, - }) |args| { - const options = try Options.parse(args); - try std.testing.expect(options.json and options.check); - try std.testing.expectEqualStrings("repo root", options.root); - } - for ([_][]const []const u8{ - &.{ "--reps", "3" }, - &.{ "--json", "--unknown" }, - &.{ "repo", "--check=true" }, - }) |args| try std.testing.expectError(error.UnknownArgument, Options.parse(args)); - try std.testing.expectError(error.MultipleRoots, Options.parse(&.{ "first", "second" })); - try std.testing.expectError(error.MultipleRoots, Options.parse(&.{ "first", "--check", "second" })); -} - /// The process's Io, for the queries: their waits are woken by the client's /// reader threads, which a single-threaded Io cannot be. var query_io: std.Io = undefined; @@ -194,35 +173,6 @@ fn runOnce(gpa: std.mem.Allocator, req_in: lsp.Req, expected: []const u8, r: *Re return ns / 1000; } -test "lspbench check rejects omitted empty and incorrect probes" { - var result: Result = .{ .kind = .definition }; - try std.testing.expectError(error.MissingProbes, checkResults(&.{}, 1)); - try std.testing.expectError(error.IncorrectProbe, checkResults(&.{result}, 1)); - result.accept("actual.zig:1:1: symbol\n", "expected.zig"); - try std.testing.expect(!result.empty); - try std.testing.expectError(error.IncorrectProbe, checkResults(&.{result}, 1)); - result.accept("actual.zig:1:1: symbol\n", "actual.zig"); - try checkResults(&.{result}, 1); - try std.testing.expectError(error.MissingProbes, checkResults(&.{result}, 2)); - result.accept("", ""); - try std.testing.expectError(error.IncorrectProbe, checkResults(&.{result}, 1)); -} - -test "lspbench reports missing fixture and anchor before querying a backend" { - var tmp = std.testing.tmpDir(.{}); - defer tmp.cleanup(); - var path_buf: [4096]u8 = undefined; - const root = path_buf[0..try tmp.dir.realPath(std.testing.io, &path_buf)]; - const anchor: Anchor = .{ .file = "source.zig", .needle = "pub const value", .kind = .definition }; - try std.testing.expectError(error.OpenFailed, probe(std.testing.allocator, root, anchor)); - try tmp.dir.writeFile(std.testing.io, .{ .sub_path = anchor.file, .data = "const value = 1;\n" }); - try std.testing.expectError(error.MissingAnchor, probe(std.testing.allocator, root, anchor)); - var invalid = anchor; - invalid.needle = "value"; - invalid.at = 6; - try std.testing.expectError(error.InvalidAnchor, probe(std.testing.allocator, root, invalid)); -} - fn reportText(rs: []const Result, rss: u64) void { const o = std.debug.print; o("backend: {s}\n\n", .{lsp.backend_name}); |
