2023-12-02 17:34:17 +04:00
|
|
|
#!/usr/bin/sh
|
|
|
|
|
2023-12-02 19:45:58 +04:00
|
|
|
set -e
|
|
|
|
|
2023-12-02 17:34:17 +04:00
|
|
|
test_case() {
|
|
|
|
[[ $(bin/day$1p$2 < day$1/in.$3) = "$4" ]] && { echo -ne "\e[32mpassed\e[0m"; } || { echo -ne "\e[31mfailed\e[0m"; }
|
|
|
|
}
|
|
|
|
|
2023-12-02 19:45:58 +04:00
|
|
|
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").";
|
2023-12-03 18:27:32 +04:00
|
|
|
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").";
|