diff --git a/cmd/mothd/testdata/testpiler.sh b/cmd/mothd/testdata/testpiler.sh index 2450d96..60da536 100755 --- a/cmd/mothd/testdata/testpiler.sh +++ b/cmd/mothd/testdata/testpiler.sh @@ -6,31 +6,35 @@ fail () { } case "$ACTION:$CAT:$POINTS" in -inventory::) - echo "pategory 1 2 3 4 5 10 20 300" - echo "nealegory 1 3 2" - ;; -open:*:*) - case "$CAT:$POINTS:$FILENAME" in - *:*:moo.txt) - echo "Moo." + inventory::) + cat <&2 + exit 1 +} + +case $1:$2:$3 in + inventory::) + echo "[1,2,3," + echo "4,5]" + ;; + puzzle:1:) + cat <moo." + } +} +EOT + ;; + puzzle:*:) + fail "No such puzzle" + ;; + file:1:moo.txt) + echo "Moo." + ;; + file:*:*) + fail "No such file: $2" + ;; + answer:1:answer1.0) + echo "correct" + ;; + answer:1:*) + echo "incorrect" + ;; + answer:*:*) + fail "Fail answer" + ;; + *) + fail "What is $1" 1>&2 + ;; +esac diff --git a/cmd/transpile/testdata/1/puzzle.md b/cmd/transpile/testdata/static/1/puzzle.md similarity index 100% rename from cmd/transpile/testdata/1/puzzle.md rename to cmd/transpile/testdata/static/1/puzzle.md diff --git a/cmd/transpile/testdata/2/moo.js b/cmd/transpile/testdata/static/2/moo.js similarity index 100% rename from cmd/transpile/testdata/2/moo.js rename to cmd/transpile/testdata/static/2/moo.js diff --git a/cmd/transpile/testdata/2/moo.txt b/cmd/transpile/testdata/static/2/moo.txt similarity index 100% rename from cmd/transpile/testdata/2/moo.txt rename to cmd/transpile/testdata/static/2/moo.txt diff --git a/cmd/transpile/testdata/2/puzzle.md b/cmd/transpile/testdata/static/2/puzzle.md similarity index 100% rename from cmd/transpile/testdata/2/puzzle.md rename to cmd/transpile/testdata/static/2/puzzle.md diff --git a/cmd/transpile/testdata/3/mkpuzzle b/cmd/transpile/testdata/static/3/mkpuzzle similarity index 100% rename from cmd/transpile/testdata/3/mkpuzzle rename to cmd/transpile/testdata/static/3/mkpuzzle