Add 'no changes' test to zig fmt cli test

This commit is contained in:
Ryan Liptak 2020-06-20 22:21:23 -07:00
parent b216d8de88
commit 399f6b77c4

View File

@ -165,4 +165,8 @@ fn testZigFmt(zig_exe: []const u8, dir_path: []const u8) !void {
// running it on the dir, only the new file should be changed
testing.expect(std.mem.startsWith(u8, run_result2.stderr, fmt2_zig_path));
testing.expect(run_result2.stderr.len == fmt2_zig_path.len + 1 and run_result2.stderr[run_result2.stderr.len - 1] == '\n');
const run_result3 = try exec(dir_path, &[_][]const u8{ zig_exe, "fmt", dir_path });
// both files have been formatted, nothing should change now
testing.expect(run_result3.stderr.len == 0);
}