Added testing ability
For the full details, see patches/README.md :-)
This commit is contained in:
parent
95c8ea3cb3
commit
6ccd55729e
49 changed files with 160 additions and 9 deletions
24
patches/gollum.sh
Executable file
24
patches/gollum.sh
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# "It isn't fair, my precious, is it,
|
||||
# to ask us what it's got in it's
|
||||
# nassty little pocketsess?"
|
||||
# Gollum, The Hobbit, or There and Back Again
|
||||
#
|
||||
|
||||
cd $(dirname $(which $0))
|
||||
f=$(basename ../exercises/$1*.zig .zig 2> /dev/null)
|
||||
b=../exercises/$f.zig
|
||||
a=../answers/$f.zig
|
||||
p=$f.patch
|
||||
|
||||
printf "\tf: '$f'\n\tb: '$b'\n\ta: '$a'\n"
|
||||
|
||||
if [[ ! -f $b ]]; then echo "We hates it!"; exit 1; fi
|
||||
if [[ ! -a $a ]]; then echo "Where is it? Where is the answer, precious?"; exit; fi
|
||||
|
||||
echo Hisssss!
|
||||
|
||||
diff $b $a > $p
|
||||
|
||||
cat $p
|
||||
Loading…
Add table
Add a link
Reference in a new issue