mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
command: fix hostname test compatibility
hostname is not guaranteed on *nix as in the comment. For example, Arch does not have hostname by default.
This commit is contained in:
@ -440,9 +440,9 @@ fn isExecutable(mode: std.fs.File.Mode) bool {
|
||||
return mode & 0o0111 != 0;
|
||||
}
|
||||
|
||||
// `hostname` is present on both *nix and windows
|
||||
// `uname -n` is the *nix equivalent of `hostname.exe` on Windows
|
||||
test "expandPath: hostname" {
|
||||
const executable = if (builtin.os.tag == .windows) "hostname.exe" else "hostname";
|
||||
const executable = if (builtin.os.tag == .windows) "hostname.exe" else "uname";
|
||||
const path = (try expandPath(testing.allocator, executable)).?;
|
||||
defer testing.allocator.free(path);
|
||||
try testing.expect(path.len > executable.len);
|
||||
|
Reference in New Issue
Block a user