diff options
Diffstat (limited to 'src/ninep')
| -rw-r--r-- | src/ninep/ctl.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index 697ef594..2fa0cd7e 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -4467,3 +4467,13 @@ test "a Mount of a socket path that is not there says no such socket, ENOENT" { try testing.expectEqual(@as(usize, 0), p.fs.mounts.items.len); try testing.expectEqual(E.INVAL, wr(p, @intFromEnum(tree.TopFile.ctl), "Mount peer rel/x.sock\n").errno()); } + +test "the init file reads past a BOM, and every line it fails is a notice and an err, never silent" { + const p = try Pardes.init(testing.allocator, .{ .tty_only = true, .startup_config = "\xEF\xBB\xBFTheme dusk\nnosuchword 1\nTheme nosuchtheme\n# a comment\nInactiveDim 30 # not a comment, a bad value\n" }); + defer p.deinit(); + try testing.expectEqualStrings("dusk", p.theme().name); + try testing.expect(th.logHas(p, "err - init file line 2: unknown word \"nosuchword 1\"")); + try testing.expect(th.logHas(p, "err - init file line 3: ")); + try testing.expect(!th.logHas(p, "line 4")); + try testing.expect(th.logHas(p, "err - init file line 5: ")); +} |
