Sidebar

Ziglang

"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearZI
Ziglang huntrss 1 year ago 100%
Webdemos in Zig https://zigurust.gitlab.io/blog/posts/webdemos/

I ported webdemos from [http://cliffle.com] to Zig and wrote down some insights into a blog post.

1
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearZI
Ziglang Metasyntactic 1 year ago 100%
Three Different Cuts: Rust, Go, Zig https://matklad.github.io/2023/07/16/three-different-cuts.html
1
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearZI
Ziglang aion 1 year ago 100%
Using expectEqual

Is this the best way to use `expectEqual`? ```zig fn add(a: i64, b: i64) i64 { return a + b; } test "basic test" { try std.testing.expectEqual(@as(i64, 10), add(3, 7)); } ``` Without the `@as` the test doesn't even compile: ``` ./src/main.zig:12:40: error: expected type 'comptime_int', found 'i64' try std.testing.expectEqual(10, add(3, 7)); ``` Having to use `@as` seems makes the test less readable. It seems to me inferring the type of `expected` from the type of `actual` would make more sense.

1
0