| author | |
| committer | |
| log | b5915131ce5b41e58a901973b518f9769215e754 |
| tree | bf8b0abea08a3e3e070975bc36714634328c7421 |
| parent | 6da75a0abf28b1b9ff74c6d54e0eba0bf647f9ad |
3 files changed, 8 insertions(+), 8 deletions(-)
build.zig+2-2| ... | @@ -6,11 +6,11 @@ pub fn build(b: *std.Build) void { | ... | @@ -6,11 +6,11 @@ pub fn build(b: *std.Build) void { |
| 6 | 6 | ||
| 7 | _ = b.addModule( | 7 | _ = b.addModule( |
| 8 | "extras", | 8 | "extras", |
| 9 | .{ .root_source_file = .{ .path = "src/lib.zig" } }, | 9 | .{ .root_source_file = b.path("src/lib.zig") }, |
| 10 | ); | 10 | ); |
| 11 | 11 | ||
| 12 | const exe_unit_tests = b.addTest(.{ | 12 | const exe_unit_tests = b.addTest(.{ |
| 13 | .root_source_file = .{ .path = "src/lib.zig" }, | 13 | .root_source_file = b.path("src/lib.zig"), |
| 14 | .target = target, | 14 | .target = target, |
| 15 | .optimize = mode, | 15 | .optimize = mode, |
| 16 | }); | 16 | }); |
src/FlippedInt.zig+5-5| ... | @@ -27,17 +27,17 @@ test { | ... | @@ -27,17 +27,17 @@ test { |
| 27 | try std.testing.expect(FlippedInt(u5) == i5); | 27 | try std.testing.expect(FlippedInt(u5) == i5); |
| 28 | } | 28 | } |
| 29 | test { | 29 | test { |
| 30 | try std.testing.expect(FlippedInt(i1) == u0); | 30 | try std.testing.expect(FlippedInt(i1) == u1); |
| 31 | } | 31 | } |
| 32 | test { | 32 | test { |
| 33 | try std.testing.expect(FlippedInt(i2) == u1); | 33 | try std.testing.expect(FlippedInt(i2) == u2); |
| 34 | } | 34 | } |
| 35 | test { | 35 | test { |
| 36 | try std.testing.expect(FlippedInt(i3) == u2); | 36 | try std.testing.expect(FlippedInt(i3) == u3); |
| 37 | } | 37 | } |
| 38 | test { | 38 | test { |
| 39 | try std.testing.expect(FlippedInt(i4) == u3); | 39 | try std.testing.expect(FlippedInt(i4) == u4); |
| 40 | } | 40 | } |
| 41 | test { | 41 | test { |
| 42 | try std.testing.expect(FlippedInt(i5) == u4); | 42 | try std.testing.expect(FlippedInt(i5) == u5); |
| 43 | } | 43 | } |
src/hashFile.zig+1-1| ... | @@ -18,7 +18,7 @@ pub fn hashFile(dir: std.fs.Dir, sub_path: string, comptime Algo: type) ![Algo.d | ... | @@ -18,7 +18,7 @@ pub fn hashFile(dir: std.fs.Dir, sub_path: string, comptime Algo: type) ![Algo.d |
| 18 | 18 | ||
| 19 | test { | 19 | test { |
| 20 | const tdir = std.testing.tmpDir(.{}).dir; | 20 | const tdir = std.testing.tmpDir(.{}).dir; |
| 21 | try tdir.writeFile("yo.txt", "hello"); | 21 | try tdir.writeFile(.{ .sub_path = "yo.txt", .data = "hello" }); |
| 22 | const A = std.crypto.hash.sha2.Sha256; | 22 | const A = std.crypto.hash.sha2.Sha256; |
| 23 | const expected = "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824".*; | 23 | const expected = "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824".*; |
| 24 | try std.testing.expect(std.mem.eql(u8, &try hashFile(tdir, "yo.txt", A), &expected)); | 24 | try std.testing.expect(std.mem.eql(u8, &try hashFile(tdir, "yo.txt", A), &expected)); |