test:zig
This commit is contained in:
15
guide/language/hello-world.zig
Normal file
15
guide/language/hello-world.zig
Normal file
@@ -0,0 +1,15 @@
|
||||
const std = @import("std");
|
||||
const print = std.debug.print;
|
||||
|
||||
// $ zig run hello-world.zig
|
||||
pub fn main() void {
|
||||
print("Hello, {s}!\n", .{"World"});
|
||||
}
|
||||
|
||||
pub fn test_hello_world() []const u8 {
|
||||
return "Hello, Test!\n";
|
||||
}
|
||||
|
||||
test "hello-world" {
|
||||
try std.testing.expectEqualStrings(test_hello_world(), "Hello, Test!\n");
|
||||
}
|
||||
Reference in New Issue
Block a user