summaryrefslogtreecommitdiff
path: root/src/Query.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Query.zig')
-rw-r--r--src/Query.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Query.zig b/src/Query.zig
index 09b46f3b..55d7b0b5 100644
--- a/src/Query.zig
+++ b/src/Query.zig
@@ -2762,7 +2762,7 @@ test "a query row's place is its text: the match tinted after it, B3 on it opens
File.setContent(p, &sp.file.?, try p.gpa.dupe(u8, saved));
try std.testing.expect(sp.query == null and sp.file.?.location_rows.len == 0);
const at = std.mem.indexOf(u8, saved, "a.txt:2:5").?;
- const line = saved[at .. std.mem.indexOfScalarPos(u8, saved, at, '\n').?];
+ const line = saved[at..std.mem.indexOfScalarPos(u8, saved, at, '\n').?];
const word = look.expandedWord(line, 3).?;
a.body.cur_row = 0;
look.lookAt(p, sid, line[word.lo..word.hi]);
@@ -2849,7 +2849,9 @@ test "a row's address is the shortest path a Look from the query pane resolves:
// Looked at from the pane: the row's file, at its line
var realbuf: [4096]u8 = undefined;
const t = look.resolve(p, addr, dir, &realbuf);
- try std.testing.expectEqualStrings(row.path, t.file.path);
+ var expected_buf: [4096]u8 = undefined;
+ const expected = expected_buf[0..try std.Io.Dir.cwd().realPathFile(std.testing.io, row.path, &expected_buf)];
+ try std.testing.expectEqualStrings(expected, t.file.path);
try std.testing.expectEqual(row.at.line, t.file.at.line);
}
for ([_][]const u8{ "here.txt:2:1", "sub/deep.txt:2:1", "../up.txt:2:1", far ++ ":1:1" }) |want| {