Commit 982da1b9be002de5e4bd94f07f7ec62ddd2bc91a Parent: 60624582faf0e7f09b24b548a87b2cebd38d61e4 Author: mcol <mcol@posteo.net> Date: 2021-11-26 21:43:05 +0000 Committer: mcol <mcol@posteo.net> Committed: 2021-11-26 21:43:05 +0000 restore tests, and clean up test files
test/test.sh Modified
@@ -15,9 +15,7 @@ ' -exit 0 - -set -ue +set -u if [[ $(basename "$PWD") != gitserve ]] then @@ -28,6 +26,7 @@ let errors="0" "1" EXPECTED="test/expected" RESULT="test/result" +rm -fr "$RESULT" declare -a TESTS TESTS=( @@ -40,8 +39,12 @@ "gitserve/file/test.templates.style.css.html" ) -rm -rf "$RESULT" -stack run -- -c test/config.dhall -q +finish() { + rm -r "$RESULT" + exit $1 +} + +stack run -- -c test/config.dhall -q || finish 1 for test in "${TESTS[@]}" do @@ -60,10 +63,10 @@ case "$errors" in 0) echo "All good!" - exit 0 + finish 0 ;; *) echo "Had this many errors: $errors" - exit $errors + finish $errors ;; esac
test/templates/repo/index.html Modified
@@ -10,8 +10,8 @@ commits: (skipped) tree: (skipped) tags: (skipped) -branches: (skipped) - branches[0].name: (skipped) +branches: {{ branches }} + branches[0].name: {{ branches[0].name }} readme.path: {{ readme.path }} license.path: {{ license.path }} {% endblock %}
test/templates/repo/file.html Modified
@@ -22,8 +22,8 @@ commits: (skipped) tree: (skipped) tags: (skipped) -branches: (skipped) - branches[0].name: (skipped) +branches: {{ branches }} + branches[0].name: {{ branches[0].name }} readme.path: {{ readme.path }} license.path: {{ license.path }} {% endblock %}
test/expected/gitserve/index.html Modified
@@ -7,7 +7,7 @@ commits: (skipped) tree: (skipped) tags: (skipped) -branches: (skipped) - branches[0].name: (skipped) +branches: master + branches[0].name: master readme.path: README.rst license.path: LICENSE
test/expected/gitserve/file/test.templates.style.css.html Modified
@@ -17,7 +17,7 @@ commits: (skipped) tree: (skipped) tags: (skipped) -branches: (skipped) - branches[0].name: (skipped) +branches: master + branches[0].name: master readme.path: README.rst license.path: LICENSE
test/expected/gitserve/file/test.templates.html Modified
@@ -17,7 +17,7 @@ commits: (skipped) tree: (skipped) tags: (skipped) -branches: (skipped) - branches[0].name: (skipped) +branches: master + branches[0].name: master readme.path: README.rst license.path: LICENSE