summaryrefslogtreecommitdiff
path: root/lambda-calcul/haskell/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lambda-calcul/haskell/test.sh')
-rwxr-xr-xlambda-calcul/haskell/test.sh45
1 files changed, 0 insertions, 45 deletions
diff --git a/lambda-calcul/haskell/test.sh b/lambda-calcul/haskell/test.sh
deleted file mode 100755
index 6bb9dc4..0000000
--- a/lambda-calcul/haskell/test.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/env bash
-
-set -euo pipefail
-
-HOST=${1:-https://lambda.pankzsoft.net}
-
-post () {
- url=$1
- data=$2
-
- curl -s -X POST -H 'content-type: application/json' "$url" -d "$data"
-}
-
-get () {
- url=$1
-
- curl -s -X GET -H 'content-type: application/json' "$url"
-}
-
-ALICE=$(post $HOST/api/register '"alice"' | jq -r)
-echo "registered alice with token '$ALICE'"
-sleep 2
-
-for i in $(seq 1 14); do
- GRADE=$(get "$HOST/api/score?token=$ALICE" | jq -r .grade)
- echo "alice's grade is $GRADE"
- sleep 1
-
- CHAL=$(get "$HOST/api/challenge?token=$ALICE" | jq -r .expr)
- echo "alice's challenge is '$CHAL'"
- sleep 1
-
- ANSWER=$(echo "$CHAL" | cabal run)
- echo "alice's answer is '$ANSWER'"
-
- RESULT=$(post "$HOST/api/challenge?token=$ALICE" "\"$ANSWER\"")
-
- if [ "$RESULT" != "[]" ]; then
- echo "Failed challenge: $RESULT"
- fi
-done
-
-SCORE=$(curl -s -X DELETE -H 'content-type: application/json' "$HOST/api/register?token=$ALICE")
-
-echo "Unregistered alice: $SCORE"