authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2024-09-21 17:23:06 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2024-09-21 17:23:06 -07:00
logb5915131ce5b41e58a901973b518f9769215e754
treebf8b0abea08a3e3e070975bc36714634328c7421
parent6da75a0abf28b1b9ff74c6d54e0eba0bf647f9ad

zigmod-test-changes fixes


3 files changed, 8 insertions(+), 8 deletions(-)

build.zig+2-2
......@@ -6,11 +6,11 @@ pub fn build(b: *std.Build) void {
66
77 _ = b.addModule(
88 "extras",
9 .{ .root_source_file = .{ .path = "src/lib.zig" } },
9 .{ .root_source_file = b.path("src/lib.zig") },
1010 );
1111
1212 const exe_unit_tests = b.addTest(.{
13 .root_source_file = .{ .path = "src/lib.zig" },
13 .root_source_file = b.path("src/lib.zig"),
1414 .target = target,
1515 .optimize = mode,
1616 });
src/FlippedInt.zig+5-5
......@@ -27,17 +27,17 @@ test {
2727 try std.testing.expect(FlippedInt(u5) == i5);
2828}
2929test {
30 try std.testing.expect(FlippedInt(i1) == u0);
30 try std.testing.expect(FlippedInt(i1) == u1);
3131}
3232test {
33 try std.testing.expect(FlippedInt(i2) == u1);
33 try std.testing.expect(FlippedInt(i2) == u2);
3434}
3535test {
36 try std.testing.expect(FlippedInt(i3) == u2);
36 try std.testing.expect(FlippedInt(i3) == u3);
3737}
3838test {
39 try std.testing.expect(FlippedInt(i4) == u3);
39 try std.testing.expect(FlippedInt(i4) == u4);
4040}
4141test {
42 try std.testing.expect(FlippedInt(i5) == u4);
42 try std.testing.expect(FlippedInt(i5) == u5);
4343}
src/hashFile.zig+1-1
......@@ -18,7 +18,7 @@ pub fn hashFile(dir: std.fs.Dir, sub_path: string, comptime Algo: type) ![Algo.d
1818
1919test {
2020 const tdir = std.testing.tmpDir(.{}).dir;
21 try tdir.writeFile("yo.txt", "hello");
21 try tdir.writeFile(.{ .sub_path = "yo.txt", .data = "hello" });
2222 const A = std.crypto.hash.sha2.Sha256;
2323 const expected = "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824".*;
2424 try std.testing.expect(std.mem.eql(u8, &try hashFile(tdir, "yo.txt", A), &expected));