mirror of
https://github.com/ziglang/zig.git
synced 2025-12-27 16:43:07 +00:00
Instead of `zig init-lib` and `zig init-exe`, now there is only `zig init`, which initializes any of the template files that do not already exist, and makes a package that contains both an executable and a static library. The idea is that the user can delete whatever they don't want. In fact, I think even more things should be added to the build.zig template.
11 lines
191 B
Zig
11 lines
191 B
Zig
const std = @import("std");
|
|
const testing = std.testing;
|
|
|
|
export fn add(a: i32, b: i32) i32 {
|
|
return a + b;
|
|
}
|
|
|
|
test "basic add functionality" {
|
|
try testing.expect(add(3, 7) == 10);
|
|
}
|