diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-09-17 17:08:56 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-09-17 17:11:18 -0400 |
| commit | 4c6f1e614a204293732004ef844e8bb057bdc212 (patch) | |
| tree | 5b9ce7cf5888d2122406b79001325ed770d5d872 /std/special/init-lib/src | |
| parent | 9c9eefc841b577f646a54e74c8970e074162b594 (diff) | |
| download | zig-4c6f1e614a204293732004ef844e8bb057bdc212.tar.gz zig-4c6f1e614a204293732004ef844e8bb057bdc212.zip | |
remove `zig build --init`. add `zig init-lib` and `zig init-exe`
init-lib creates a working static library with tests, and
init-exe creates a working hello world with a `run` target.
both now have test coverage with the new "cli tests" file.
closes #1035
Diffstat (limited to 'std/special/init-lib/src')
| -rw-r--r-- | std/special/init-lib/src/main.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/std/special/init-lib/src/main.zig b/std/special/init-lib/src/main.zig new file mode 100644 index 0000000000..27fdeb2030 --- /dev/null +++ b/std/special/init-lib/src/main.zig @@ -0,0 +1,10 @@ +const std = @import("std"); +const assertOrPanic = std.debug.assertOrPanic; + +export fn add(a: i32, b: i32) i32 { + return a + b; +} + +test "basic add functionality" { + assertOrPanic(add(3, 7) == 10); +} |
