authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-01-01 20:53:24 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-01-01 20:53:24 -08:00
log54c2e792a3916fa227322f62bfe8f5a01a25aac4
tree7249958639cc2c1cecb668cfbceaf36da6711870
parent9c1edaafed430d8e85175781781eba6214e4cb13

use expect in tests


3 files changed, 6 insertions(+), 1 deletions(-)

licenses.txt+1
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1MIT:1MIT:
2= https://spdx.org/licenses/MIT2= https://spdx.org/licenses/MIT
3- This3- This
4- git https://github.com/nektro/zig-expect
4- git https://github.com/nektro/zig-extras5- git https://github.com/nektro/zig-extras
5- git https://github.com/yaml/libyaml6- git https://github.com/yaml/libyaml
test.zig+2-1
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("std");1const std = @import("std");
2const yaml = @import("yaml");2const yaml = @import("yaml");
3const expect = @import("expect").expect;
34
4const file = @embedFile("./zigmod.yml");5const file = @embedFile("./zigmod.yml");
56
...@@ -7,5 +8,5 @@ test {...@@ -7,5 +8,5 @@ test {
7 const doc = try yaml.parse(std.testing.allocator, file);8 const doc = try yaml.parse(std.testing.allocator, file);
8 defer doc.deinit(std.testing.allocator);9 defer doc.deinit(std.testing.allocator);
910
10 try std.testing.expectEqualStrings("g982zq6e8wsvnmduerpbf8787hu85brugmngn8wf", doc.mapping.get_string("id").?);11 try expect(doc.mapping.get_string("id").?).toEqualString("g982zq6e8wsvnmduerpbf8787hu85brugmngn8wf");
11}12}
zigmod.yml+3
...@@ -26,3 +26,6 @@ dependencies:...@@ -26,3 +26,6 @@ dependencies:
26 - src/writer.c26 - src/writer.c
2727
28 - src: git https://github.com/nektro/zig-extras28 - src: git https://github.com/nektro/zig-extras
29
30root_dependencies:
31 - src: git https://github.com/nektro/zig-expect