diff options
Diffstat (limited to 'test/process/terminals.zig')
| -rw-r--r-- | test/process/terminals.zig | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/process/terminals.zig b/test/process/terminals.zig index e810ceb1..0c95e960 100644 --- a/test/process/terminals.zig +++ b/test/process/terminals.zig @@ -118,15 +118,19 @@ fn runFile(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try expectEqualStrings("error not run\n", try run(a, c, term, "fi\n")); // a syntax error runs nothing try expectEqualStrings("error not run\n", try run(a, c, term, "echo 'open\n")); // nor does an open quote try expectEqualStrings("exit 0\n", try run(a, c, term, "true\n")); // ...and the shell is clear after - // With no frontend attached the pty's size is in pixels too, at a - // nominal 8x16 cell: a program sizes its kitty graphics by it. + // The pty's size is in pixels too: with no frontend attached at a + // nominal 8x16 cell, in a window at its font's cell. A program sizes + // its kitty graphics by it. const said = try run(a, c, term, "python3 -c 'import fcntl,termios,struct;print(*struct.unpack(\"4H\",fcntl.ioctl(0,termios.TIOCGWINSZ,bytes(8))))'\n"); var lines = std.mem.splitScalar(u8, said, '\n'); _ = lines.next(); var size = std.mem.tokenizeScalar(u8, lines.next() orelse "", ' '); var n: [4]u32 = undefined; for (&n) |*v| v.* = try std.fmt.parseInt(u32, size.next() orelse return error.NoSize, 10); - try expect(n[2] == n[1] * 8 and n[3] == n[0] * 16 and n[2] > 0); + if (process.backend == .gui) + try expect(n[2] > 0 and n[3] > 0 and n[2] % n[1] == 0 and n[3] % n[0] == 0) + else + try expect(n[2] == n[1] * 8 and n[3] == n[0] * 16 and n[2] > 0); // A paging command run through pty/run does not wait in less: the // terminal's PAGER is `pardes -`, and its text is a +Pager pane. if (shell(a, "command -v git >/dev/null", .{}) == 0) { |
