1
Fork 0

make unix2db tests more robust

main
Motiejus Jakštys 2022-07-21 11:12:04 +03:00
parent 6c311b786f
commit 2ceb3d5c29
1 changed files with 7 additions and 2 deletions

View File

@ -148,7 +148,12 @@ test "turbonss-unix2db invalid argument" {
test "turbonss-unix2db trivial error: missing passwd file" {
const allocator = testing.allocator;
const args = &[_][*:0]const u8{};
const args = &[_][*:0]const u8{
"--passwd",
"/does/not/exist/passwd",
"--group",
"/does/not/exist/group",
};
var stderr = ArrayList(u8).init(allocator);
defer stderr.deinit();
var stdout = ArrayList(u8).init(allocator);
@ -156,7 +161,7 @@ test "turbonss-unix2db trivial error: missing passwd file" {
const exit_code = execute(allocator, stdout.writer(), stderr.writer(), args[0..]);
try testing.expectEqual(@as(u8, 1), exit_code);
try testing.expectEqualStrings(stderr.items, "ERROR FileNotFound: open 'passwd'\n");
try testing.expectEqualStrings(stderr.items, "ERROR FileNotFound: open '/does/not/exist/passwd'\n");
}
test "turbonss-unix2db fail" {