summaryrefslogtreecommitdiff
path: root/aoc24/src
diff options
context:
space:
mode:
Diffstat (limited to 'aoc24/src')
-rw-r--r--aoc24/src/dayX.zig21
1 files changed, 21 insertions, 0 deletions
diff --git a/aoc24/src/dayX.zig b/aoc24/src/dayX.zig
index 295b57e..6011887 100644
--- a/aoc24/src/dayX.zig
+++ b/aoc24/src/dayX.zig
@@ -2,18 +2,39 @@ const std = @import("std");
const Input = struct {};
+const test_input =
+ \\
+;
+
pub fn parse(allocator: std.mem.Allocator, data: []const u8) !Input {
_ = allocator;
_ = data;
return .{};
}
+test "part1" {
+ var arena = std.heap.ArenaAllocator.init(std.testing.allocator);
+ defer arena.deinit();
+
+ const output = try part1(arena.allocator(), try parse(arena.allocator(), test_input));
+ try std.testing.expectEqual(1, output);
+}
+
pub fn part1(allocator: std.mem.Allocator, input: Input) !u32 {
_ = allocator;
_ = input;
return 0;
}
+test "part2" {
+ var arena = std.heap.ArenaAllocator.init(std.testing.allocator);
+ defer arena.deinit();
+
+ const output = try part2(arena.allocator(), try parse(arena.allocator(), test_input));
+ std.debug.print("got {}\n", .{output});
+ try std.testing.expectEqual(2, output);
+}
+
pub fn part2(allocator: std.mem.Allocator, input: Input) !u32 {
_ = allocator;
_ = input;