aoc2023/test

8 lines
372 B
Plaintext
Raw Normal View History

2023-12-02 17:34:17 +04:00
#!/usr/bin/sh
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").";