Move tons of stuff into oldstuff/

This commit is contained in:
2020-06-04 09:54:59 -04:00
parent 49038bb8ef
commit aa1345b6ed
213 changed files with 0 additions and 12 deletions

View File

@@ -0,0 +1,47 @@
#!/usr/bin/env bash
set -e
[[ $DEBUG ]] && set -x
test_ex17-ec() {
local testdb=$(mktemp /var/tmp/XXXXXXX.dat)
trap "rm ${testdb}" EXIT INT TERM
./ex17-ec "${testdb}" c
./ex17-ec "${testdb}" l &>/dev/null
./ex17-ec "${testdb}" s 1 nancy pwnr@dungeon.info "Dark corner"
./ex17-ec "${testdb}" s 2 fran eagleeye16@hotmail.com "Falcon's nest"
./ex17-ec "${testdb}" l &>/dev/null
./ex17-ec "${testdb}" d 1
./ex17-ec "${testdb}" s 1 portia wanda@aeromar.mx "Fancy town"
./ex17-ec "${testdb}" f nest &>/dev/null
}
test_ex18() {
local output=$(./ex18 4 1 7 3 2 0 8)
[[ "${output}" =~ '0 1 2 3 4 7 8' ]]
[[ "${output}" =~ '8 7 4 3 2 1 0' ]]
[[ "${output}" =~ '3 4 2 7 1 0 8' ]]
}
test_ex19() {
printf "l\nn\nl\ne\nw\nw\nl\na\na\na\na\na\na\na\na\na\na\n" \
| ./ex19 &>/dev/null
printf "l\nl\nl\nl\na\na\nx\nq\nz\nn\n" | ./ex19 &>/dev/null
for i in {0..20} ; do
echo "${RANDOM}" | md5sum | ./ex19 &>/dev/null
done
}
main() {
for ex in $(./list-exercises) ; do
func_name="test_${ex}"
if type "${func_name}" &>/dev/null ; then
echo -en "---> ${ex}: "
"${func_name}"
echo "OK"
fi
done
}
main "$@"