summaryrefslogtreecommitdiff
path: root/test/panes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-15 18:23:06 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commitf3a9a1a9005024923f32e1acae5ecd509e9bbfd2 (patch)
tree9a2ef0d4cf5eb70c90a6455a3a905f27888e5f05 /test/panes.zig
parent0b6bd969ce9982aa7c8b31c38e64034d3d949b8e (diff)
downloadpardes-f3a9a1a9005024923f32e1acae5ecd509e9bbfd2.tar.gz
pardes-f3a9a1a9005024923f32e1acae5ecd509e9bbfd2.zip
Show result declaration locations only on their first header line
Diffstat (limited to 'test/panes.zig')
-rw-r--r--test/panes.zig13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/panes.zig b/test/panes.zig
index da06f692..d844f26e 100644
--- a/test/panes.zig
+++ b/test/panes.zig
@@ -2322,6 +2322,7 @@ const OutputTests = struct {
if (row.kind == .match) {
matches += 1;
try std.testing.expect(!row.declaration);
+ try std.testing.expect(row.location_end > 0);
const location = panes.Output.location(line);
try std.testing.expectEqualStrings(path, location.path);
try std.testing.expectEqual(row.at, location.at);
@@ -2332,9 +2333,15 @@ const OutputTests = struct {
}
} else if (row.at.line <= 5) {
try std.testing.expect(row.declaration);
- try std.testing.expect(row.location_end > 0);
- try std.testing.expect(std.mem.startsWith(u8, line, path));
- try std.testing.expectEqualStrings(path, panes.Output.location(line).path);
+ try std.testing.expectEqualStrings(path, row.path);
+ if (row.at.line <= 3) {
+ try std.testing.expect(row.location_end > 0);
+ try std.testing.expect(std.mem.startsWith(u8, line, path));
+ try std.testing.expectEqualStrings(path, panes.Output.location(line).path);
+ } else {
+ try std.testing.expectEqual(@as(usize, 0), row.location_end);
+ try std.testing.expect(std.mem.indexOf(u8, line[0..row.code_start], path) == null);
+ }
} else {
try std.testing.expect(!row.declaration);
try std.testing.expectEqual(@as(usize, 0), row.location_end);