aoc2023/test

13 lines
589 B
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").";