aboutsummaryrefslogtreecommitdiff
path: root/src/pointer.zig
diff options
context:
space:
mode:
authorJulien Dessaux2022-08-03 22:32:09 +0200
committerJulien Dessaux2022-08-03 22:32:09 +0200
commite5eca00399e68ceec72b6a8c9e73b2052799bcd8 (patch)
tree694d0597144d12ca7eb6131aa9b76318eb4bb146 /src/pointer.zig
parentImproved main test to check for expected output (diff)
downloadzigfunge98-e5eca00399e68ceec72b6a8c9e73b2052799bcd8.tar.gz
zigfunge98-e5eca00399e68ceec72b6a8c9e73b2052799bcd8.tar.bz2
zigfunge98-e5eca00399e68ceec72b6a8c9e73b2052799bcd8.zip
Implemented decimalInput io function
Diffstat (limited to 'src/pointer.zig')
-rw-r--r--src/pointer.zig8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pointer.zig b/src/pointer.zig
index d2d24bb..75bcd10 100644
--- a/src/pointer.zig
+++ b/src/pointer.zig
@@ -342,7 +342,9 @@ test "minimal" {
const argv = [_][]const u8{"minimal"};
var p = try Pointer.init(std.testing.allocator, f, argv[0..]);
defer p.deinit();
- try std.testing.expectEqual(p.exec(io.context(std.io.getStdIn().reader(), std.io.getStdOut().writer())), pointerReturn{});
+ 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{});
}
test "almost minimal" {
const minimal = std.io.fixedBufferStream(" @").reader();
@@ -351,5 +353,7 @@ test "almost minimal" {
const argv = [_][]const u8{"minimal"};
var p = try Pointer.init(std.testing.allocator, f, argv[0..]);
defer p.deinit();
- try std.testing.expectEqual(p.exec(io.context(std.io.getStdIn().reader(), std.io.getStdOut().writer())), pointerReturn{});
+ 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{});
}