mirror of
https://github.com/sbrow/envr.git
synced 2026-06-27 18:48:33 -04:00
feat: Added zig config.
This commit is contained in:
18
src/root.zig
Normal file
18
src/root.zig
Normal file
@@ -0,0 +1,18 @@
|
||||
//! By convention, root.zig is the root source file when making a package.
|
||||
const std = @import("std");
|
||||
const Io = std.Io;
|
||||
|
||||
/// This is a documentation comment to explain the `printAnotherMessage` function below.
|
||||
///
|
||||
/// Accepting an `Io.Writer` instance is a handy way to write reusable code.
|
||||
pub fn printAnotherMessage(writer: *Io.Writer) Io.Writer.Error!void {
|
||||
try writer.print("Run `zig build test` to run the tests.\n", .{});
|
||||
}
|
||||
|
||||
pub fn add(a: i32, b: i32) i32 {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
test "basic add functionality" {
|
||||
try std.testing.expect(add(3, 7) == 10);
|
||||
}
|
||||
Reference in New Issue
Block a user