this repo has no description
at main 762 B view raw
1//! By convention, root.zig is the root source file when making a library. 2const std = @import("std"); 3 4pub fn bufferedPrint() !void { 5 // Stdout is for the actual output of your application, for example if you 6 // are implementing gzip, then only the compressed bytes should be sent to 7 // stdout, not any debugging messages. 8 var stdout_buffer: [1024]u8 = undefined; 9 var stdout_writer = std.fs.File.stdout().writer(&stdout_buffer); 10 const stdout = &stdout_writer.interface; 11 12 try stdout.print("Run `zig build test` to run the tests.\n", .{}); 13 14 try stdout.flush(); // Don't forget to flush! 15} 16 17pub export fn add(a: i32, b: i32) i32 { 18 return a + b; 19} 20 21test "basic add functionality" { 22 try std.testing.expect(add(3, 7) == 10); 23}