From 950eec898ec784fbef31a6715a60782ec01d9888 Mon Sep 17 00:00:00 2001 From: Kharec Date: Fri, 28 Nov 2025 16:47:52 +0100 Subject: [PATCH] test: add p2 unit test --- internal/2015/DayTwo/code_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/internal/2015/DayTwo/code_test.go b/internal/2015/DayTwo/code_test.go index 869346b..590033e 100644 --- a/internal/2015/DayTwo/code_test.go +++ b/internal/2015/DayTwo/code_test.go @@ -21,3 +21,23 @@ func TestPartOne(t *testing.T) { }) } } + +func TestPartTwo(t *testing.T) { + tests := []struct { + name string + input string + expected int + }{ + {"2x3x4", "2x3x4", 34}, + {"1x1x10", "1x1x10", 14}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := PartTwo([]string{tt.input}) + if got != tt.expected { + t.Errorf("PartTwo(%q) = %d, want %d", tt.input, got, tt.expected) + } + }) + } +}