summaryrefslogtreecommitdiff
path: root/test/lspbench.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/lspbench.zig')
-rw-r--r--test/lspbench.zig50
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});