summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorseth <[email protected]>2024-05-30 07:00:28 -0400
committerseth <[email protected]>2024-05-30 07:19:01 -0400
commit936db5739a58ad5d01810c60e8ebebafc93f00ab (patch)
treefd8762027d465c68f8fffdcd78fccd40a1778f94 /src
initial commit
Diffstat (limited to 'src')
-rw-r--r--src/main.zig11
-rw-r--r--src/root.zig10
2 files changed, 21 insertions, 0 deletions
diff --git a/src/main.zig b/src/main.zig
new file mode 100644
index 0000000..75e0b4b
--- /dev/null
+++ b/src/main.zig
@@ -0,0 +1,11 @@
+const std = @import("std");
+const known = @import("known-folders");
+
+pub fn main() !void {
+ const j = try known.getPath(std.heap.page_allocator, .home) orelse {
+ std.debug.print("Womp womp.\n", .{});
+ return error.CouldNotFindHome;
+ };
+
+ std.debug.print("~ is where the heart is -- or {s}.\n", .{j});
+}
diff --git a/src/root.zig b/src/root.zig
new file mode 100644
index 0000000..ecfeade
--- /dev/null
+++ b/src/root.zig
@@ -0,0 +1,10 @@
+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);
+}