authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-01-01 20:53:37 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-01-01 20:53:37 -08:00
log3b2ab7f68a85fadcb5c1b8c1048c461034dc3e29
tree78e2fa3611ec45166fbd6c8207f3042f0e744fac
parentf62caddf9f04c739245423ea068f40ce335514e9

use expect in tests


3 files changed, 4 insertions(+), 14 deletions(-)

licenses.txt+1
...@@ -1,3 +1,4 @@...@@ -1,3 +1,4 @@
1MIT:1MIT:
2= https://spdx.org/licenses/MIT2= https://spdx.org/licenses/MIT
3- This3- This
4- git https://github.com/nektro/zig-expect
test.zig+1-14
...@@ -1,19 +1,6 @@...@@ -1,19 +1,6 @@
1const std = @import("std");1const std = @import("std");
2const color = @import("color");2const color = @import("color");
33const expect = @import("expect").expect;
4fn expect(actual: anytype) Expect(@TypeOf(actual)) {
5 return .{ .actual = actual };
6}
7
8fn Expect(T: type) type {
9 return struct {
10 actual: T,
11
12 fn toEqual(self: *const @This(), expected: T) !void {
13 try std.testing.expectEqual(expected, self.actual);
14 }
15 };
16}
174
18test {5test {
19 // https://www.colorhexa.com/4fc3f76 // https://www.colorhexa.com/4fc3f7
zigmod.yml+2
...@@ -4,3 +4,5 @@ main: mod.zig...@@ -4,3 +4,5 @@ main: mod.zig
4license: MIT4license: MIT
5description: Color init and transformation library for Zig5description: Color init and transformation library for Zig
6dependencies:6dependencies:
7root_dependencies:
8 - src: git https://github.com/nektro/zig-expect