From 4b711f4eb4b3dea714e8a8f594a656a25ef76583 Mon Sep 17 00:00:00 2001 From: Ivan Reshetnikov Date: Mon, 9 Dec 2024 12:35:21 +0500 Subject: [PATCH] AoC 2024/6: add tests --- advent-of-code/2024/day_06/test.rb | 14 ++++++++++++++ advent-of-code/2024/day_06/test.txt | 10 ++++++++++ 2 files changed, 24 insertions(+) create mode 100644 advent-of-code/2024/day_06/test.rb create mode 100644 advent-of-code/2024/day_06/test.txt diff --git a/advent-of-code/2024/day_06/test.rb b/advent-of-code/2024/day_06/test.rb new file mode 100644 index 0000000..ced4026 --- /dev/null +++ b/advent-of-code/2024/day_06/test.rb @@ -0,0 +1,14 @@ +require "test/unit" +require_relative "lib" + +class TestLib < Test::Unit::TestCase + def test_example_1 + matrix = File.readlines("test.txt", chomp: true) + assert_equal(41, walk(matrix)) + end + + def test_example_2 + matrix = File.readlines("test.txt", chomp: true) + assert_equal(6, count_possible_obstructions(matrix)) + end +end diff --git a/advent-of-code/2024/day_06/test.txt b/advent-of-code/2024/day_06/test.txt new file mode 100644 index 0000000..a4eb402 --- /dev/null +++ b/advent-of-code/2024/day_06/test.txt @@ -0,0 +1,10 @@ +....#..... +.........# +.......... +..#....... +.......#.. +.......... +.#..^..... +........#. +#......... +......#...