authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2020-06-20 22:21:23-07:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2020-06-20 22:21:23-07:00
log399f6b77c40d5ebd1d54ad193a70f1935c1ebdfc
tree0abff170200356a7a001cb08fd452647f06393db
parentb216d8de886b1d3b3cebb279864ec6bc91216d3e

Add 'no changes' test to zig fmt cli test


1 files changed, 4 insertions(+), 0 deletions(-)

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