summaryrefslogtreecommitdiff
path: root/test/panes.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/panes.zig')
-rw-r--r--test/panes.zig12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/panes.zig b/test/panes.zig
index d844f26e..28af8141 100644
--- a/test/panes.zig
+++ b/test/panes.zig
@@ -975,6 +975,7 @@ const TagNameTintTests = struct {
for ([_]bool{ false, true }) |bottom| {
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 24 });
defer p.deinit();
+ p.locations_config.layout = .@"inline";
const pane = try p.setTestFile("body\n");
p.gpa.free(pane.file.?.path);
pane.file.?.path = try p.gpa.dupe(u8, "/project/界file.zig");
@@ -2129,6 +2130,7 @@ const OutputTests = struct {
test "Locations align Unicode paths by display width and preserve source indentation" {
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true });
defer p.deinit();
+ p.locations_config.layout = .@"inline";
_ = try p.setTestFile("notes\n");
try fillResults(p, 0, "/", .search, "alignment", try p.gpa.dupe(u8, "/界.zig:2:1 first\n/longer-name.zig:12:3 \tsecond\n"), null);
const result = p.panes[p.panes[0].?.search_pane.?].?;
@@ -2150,9 +2152,10 @@ const OutputTests = struct {
for ([_]bool{ false, true }) |tslocations| {
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true });
defer p.deinit();
+ p.locations_config.layout = .@"inline";
const source = "\tbefore\n\tmatch\n after\n";
const pane = try TreeContextTests.setZigFile(p, source);
- p.locations_config = .{ .context = 1, .tscontext = false, .tslocations = tslocations };
+ p.locations_config = .{ .layout = .@"inline", .context = 1, .tscontext = false, .tslocations = tslocations };
const path = pane.file.?.path;
try fillResults(p, 0, "/", .search, "neighbors", try std.fmt.allocPrint(p.gpa, "{s}:2:1 \tmatch\n", .{path}), 0);
const file = &p.panes[pane.search_pane.?].?.file.?;
@@ -2183,6 +2186,7 @@ const OutputTests = struct {
if (!syntax.enabled) return error.SkipZigTest;
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 30 });
defer p.deinit();
+ p.locations_config.layout = .@"inline";
const source = "const Box = struct {\n" ++
" pub fn run() void {\n" ++
" // unsaved before\n" ++
@@ -2297,6 +2301,7 @@ const OutputTests = struct {
if (!syntax.enabled) return error.SkipZigTest;
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 120, .rows = 40 });
defer p.deinit();
+ p.locations_config.layout = .@"inline";
const source = "const Outer = struct {\n" ++
" const Inner = struct {\n" ++
" pub fn run(\n" ++
@@ -2306,7 +2311,7 @@ const OutputTests = struct {
"\t\tcall();\n" ++
" }\n };\n};\n";
const pane = try TreeContextTests.setZigFile(p, source);
- p.locations_config = .{ .context = 1, .tscontext = true, .tslocations = true };
+ p.locations_config = .{ .layout = .@"inline", .context = 1, .tscontext = true, .tslocations = true };
const path = pane.file.?.path;
try fillResults(p, 0, "/", .search, "nesting", try std.fmt.allocPrint(p.gpa, "{s}:7:1 \t\tcall();\n{s}:2:5 const Inner = struct {{\n", .{ path, path }), 0);
const result = p.panes[pane.search_pane.?].?;
@@ -2431,6 +2436,7 @@ const OutputTests = struct {
test "generated result refills preserve unchanged selections and reset changed text" {
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 24 });
defer p.deinit();
+ p.locations_config.layout = .@"inline";
_ = try p.setTestFile("notes\n");
const content = "first\nsecond\nthird\n";
try fillResults(p, 0, "/", .{ .query = .hover }, "", try p.gpa.dupe(u8, content), null);
@@ -2474,6 +2480,7 @@ const OutputTests = struct {
test "generated result replacement cancels an in-progress body selection" {
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 24 });
defer p.deinit();
+ p.locations_config.layout = .@"inline";
_ = try p.setTestFile("notes\n");
p.presentation.enabled = false;
try fillResults(p, 0, "/", .{ .query = .hover }, "", try p.gpa.dupe(u8, "first\nsecond\nthird\n"), null);
@@ -2513,6 +2520,7 @@ const OutputTests = struct {
.rows = 24,
});
defer p.deinit();
+ p.locations_config.layout = .@"inline";
var first: [max_arg]u8 = @splat('a');
var second = first;