summaryrefslogtreecommitdiff
path: root/test/fs_namespace.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/fs_namespace.zig')
-rw-r--r--test/fs_namespace.zig12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/fs_namespace.zig b/test/fs_namespace.zig
index c856148d..8b6f245e 100644
--- a/test/fs_namespace.zig
+++ b/test/fs_namespace.zig
@@ -13,13 +13,13 @@ test "runtime Mount and Unmount copy command arguments and change Look resolutio
try std.testing.expectEqualStrings("peer", p.fs.mounts.items[0].name);
try std.testing.expectEqualStrings("/tmp/a socket.sock", p.fs.mounts.items[0].dial);
var path: [4096]u8 = undefined;
- try std.testing.expectEqualStrings("/n/peer/self/index", filesystem.resolve(p, "/n/peer/self/index", "/", &path).?.path);
+ try std.testing.expectEqualStrings("/n/peer/index", filesystem.resolve(p, "/n/peer/index", "/", &path).?.path);
try std.testing.expect(p.executeBuiltinLine(0, "Mount peer /tmp/other.sock"));
try std.testing.expectEqual(@as(usize, 1), p.fs.mounts.items.len);
try std.testing.expectEqualStrings("/tmp/a socket.sock", p.fs.mounts.items[0].dial);
try std.testing.expect(p.executeBuiltinLine(0, "Unmount peer"));
try std.testing.expectEqual(@as(usize, 0), p.fs.mounts.items.len);
- try std.testing.expect(filesystem.resolve(p, "/n/peer/self/index", "/", &path) == null);
+ try std.testing.expect(filesystem.resolve(p, "/n/peer/index", "/", &path) == null);
for ([_][]const u8{ "Mount", "Mount name", "Mount os /tmp/peer.sock", "Mount peer tcp!127.0.0.1!0", "Unmount", "Unmount name extra" }) |invalid| {
try std.testing.expect(p.executeBuiltinLine(0, invalid));
try std.testing.expectEqual(@as(usize, 0), p.fs.mounts.items.len);
@@ -185,6 +185,7 @@ test "filesystem resolves OS first then virtual with explicit mounts and parent
const fallback = filesystem.resolve(p, "index", directory, &resolved_buffer) orelse return error.MissingVirtualFallback;
try std.testing.expectEqualStrings("/virtual/index", fallback.path);
+ if (!pardes.memory.limits.embedded_sources) return;
for ([_][]const u8{ "src/pardes.zig", "/virtual/src/pardes.zig", "/virtual/src/../src/pardes.zig" }) |word| {
const found = filesystem.resolve(p, word, directory, &resolved_buffer) orelse return error.MissingEmbeddedSource;
const bytes = try filesystem.read(p, found.path);
@@ -235,6 +236,7 @@ test "explicit OS file opens and restores keep their names and request watches"
}
test "virtual file opens do not request OS watches" {
+ if (!pardes.memory.limits.embedded_sources) return error.SkipZigTest;
const p = try pardes.Pardes.init(std.testing.allocator, .{ .tty_only = true });
defer p.deinit();
while (p.nextEffect()) |_| {}
@@ -243,16 +245,16 @@ test "virtual file opens do not request OS watches" {
while (p.nextEffect()) |effect| if (effect == .watch) return error.VirtualFileWatch;
}
-test "Look at the self factory reserves its own pane and failed opens release it" {
+test "Look at the clone file reserves its own pane and failed opens release it" {
const p = try pardes.Pardes.init(std.testing.allocator, .{ .tty_only = true });
defer p.deinit();
- p.lookAt(0, "/virtual/new/ctl");
+ p.lookAt(0, "/virtual/new");
var control_count: usize = 0;
var scratch_count: usize = 0;
for (p.panes) |slot| {
const pane = slot orelse continue;
const file = pane.file orelse continue;
- if (std.mem.eql(u8, file.path, "/virtual/new/ctl")) control_count += 1;
+ if (std.mem.eql(u8, file.path, "/virtual/new")) control_count += 1;
if (file.output) |output| if (output.from == .cmd and output.from.cmd == .New) {
scratch_count += 1;
};