aoc2023/test

22 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/sh
set -e
test_case() {
[[ $(bin/day$1p$2 < day$1/in.$3) = "$4" ]] && { echo -ne "\e[32mpassed\e[0m"; } || { echo -ne "\e[31mfailed\e[0m"; }
}
echo "Day 1 with test data part 1 $(test_case 1 1 "test" "142"), and part 2 $(test_case 1 2 "test2" "281").";
echo "Day 1 with my data part 1 $(test_case 1 1 "my" "55621"), and part 2 $(test_case 1 2 "my" "53592").";
echo "Day 2 with test data part 1 $(test_case 2 1 "test" "8"), and part 2 $(test_case 2 2 "test" "2286").";
echo "Day 2 with my data part 1 $(test_case 2 1 "my" "2727"), and part 2 $(test_case 2 2 "my" "56580").";
echo "Day 3 with test data part 1 $(test_case 3 1 "test" "4361"), and part 2 $(test_case 3 2 "test" "467835").";
echo "Day 3 with my data part 1 $(test_case 3 1 "my" "550934"), and part 2 $(test_case 3 2 "my" "81997870").";
echo "Day 4 with test data part 1 $(test_case 4 1 "test" "13"), and part 2 $(test_case 4 2 "test" "30").";
echo "Day 4 with my data part 1 $(test_case 4 1 "my" "21959"), and part 2 $(test_case 4 2 "my" "5132675").";
echo "Day 5 with test data part 1 $(test_case 5 1 "test" "35"), and part 2 $(test_case 5 2 "test" "46").";
# echo "Day 5 with my data part 1 $(test_case 5 1 "my" "379811651"), and part 2 $(test_case 5 2 "my" "27992443").";