aboutsummaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorJulien Dessaux2022-08-18 20:52:07 +0200
committerJulien Dessaux2022-08-18 20:52:07 +0200
commit800c61339432258e8dad0ca7c56ddface84cab87 (patch)
tree97a170c70284fa2c9bc2145f8925acb135cccbde /src/main.zig
parentFixed bugs reported by the mycology test suite (diff)
downloadzigfunge98-800c61339432258e8dad0ca7c56ddface84cab87.tar.gz
zigfunge98-800c61339432258e8dad0ca7c56ddface84cab87.tar.bz2
zigfunge98-800c61339432258e8dad0ca7c56ddface84cab87.zip
Made the timestamp function mockable for testing purposes
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.zig b/src/main.zig
index 1608b87..4408283 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -16,13 +16,16 @@ pub fn main() anyerror!void {
defer file.close();
const env: []const [*:0]const u8 = std.os.environ;
- var i = try interpreter.Interpreter.init(gpa.allocator(), file.reader(), args, env[0..]);
+ var i = try interpreter.Interpreter.init(gpa.allocator(), file.reader(), std.time.timestamp, args, env[0..]);
defer i.deinit();
var ioContext = io.context(std.io.getStdIn().reader(), std.io.getStdOut().writer());
std.os.exit(@intCast(u8, try i.run(&ioContext)));
}
+fn testTimestamp() i64 {
+ return 1660681247;
+}
test "all" {
std.testing.refAllDecls(@This());
}