aboutsummaryrefslogtreecommitdiff
path: root/src/pointer.zig
diff options
context:
space:
mode:
authorJulien Dessaux2022-08-03 23:14:41 +0200
committerJulien Dessaux2022-08-03 23:14:41 +0200
commit8e9f1f3af037374bd4747b6879b8486833449afe (patch)
treeeeead011492d182e1ce53e96e6b48773b85ce166 /src/pointer.zig
parentImplemented decimalInput io function (diff)
downloadzigfunge98-8e9f1f3af037374bd4747b6879b8486833449afe.tar.gz
zigfunge98-8e9f1f3af037374bd4747b6879b8486833449afe.tar.bz2
zigfunge98-8e9f1f3af037374bd4747b6879b8486833449afe.zip
Simplified io context implementation
Diffstat (limited to '')
-rw-r--r--src/pointer.zig10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/pointer.zig b/src/pointer.zig
index 75bcd10..082ce37 100644
--- a/src/pointer.zig
+++ b/src/pointer.zig
@@ -342,9 +342,8 @@ test "minimal" {
const argv = [_][]const u8{"minimal"};
var p = try Pointer.init(std.testing.allocator, f, argv[0..]);
defer p.deinit();
- var ioContext = try io.context(std.testing.allocator, std.io.getStdIn().reader(), std.io.getStdOut().writer());
- defer ioContext.deinit();
- try std.testing.expectEqual(p.exec(ioContext), pointerReturn{});
+ var ioContext = io.context(std.io.getStdIn().reader(), std.io.getStdOut().writer());
+ try std.testing.expectEqual(p.exec(&ioContext), pointerReturn{});
}
test "almost minimal" {
const minimal = std.io.fixedBufferStream(" @").reader();
@@ -353,7 +352,6 @@ test "almost minimal" {
const argv = [_][]const u8{"minimal"};
var p = try Pointer.init(std.testing.allocator, f, argv[0..]);
defer p.deinit();
- var ioContext = try io.context(std.testing.allocator, std.io.getStdIn().reader(), std.io.getStdOut().writer());
- defer ioContext.deinit();
- try std.testing.expectEqual(p.exec(ioContext), pointerReturn{});
+ var ioContext = io.context(std.io.getStdIn().reader(), std.io.getStdOut().writer());
+ try std.testing.expectEqual(p.exec(&ioContext), pointerReturn{});
}