aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_util_json.sh
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2017-09-15 17:07:57 -0400
committerWaqas Hussain <waqas20@gmail.com>2017-09-15 17:07:57 -0400
commit67293fc09fea737de37a2fea7b211aa44695b5bf (patch)
treeb5cd2d09f0ee7e1e9e13feec26defe4f7d9f5003 /tests/test_util_json.sh
parent4c6c255113df008869577d4ec0291ff880b1273c (diff)
downloadprosody-67293fc09fea737de37a2fea7b211aa44695b5bf.tar.gz
prosody-67293fc09fea737de37a2fea7b211aa44695b5bf.zip
Port tests to the `busted` test runner
Diffstat (limited to 'tests/test_util_json.sh')
-rwxr-xr-xtests/test_util_json.sh39
1 files changed, 0 insertions, 39 deletions
diff --git a/tests/test_util_json.sh b/tests/test_util_json.sh
deleted file mode 100755
index bbbd132b..00000000
--- a/tests/test_util_json.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-
-export LUA_PATH="../?.lua;;"
-export LUA_CPATH="../?.so;;"
-
-#set -x
-
-if ! which "$RUNWITH"; then
- echo "Unable to find interpreter $RUNWITH";
- exit 1;
-fi
-
-if ! $RUNWITH -e 'assert(require"util.json")' 2>/dev/null; then
- echo "Unable to find util.json";
- exit 1;
-fi
-
-FAIL=0
-
-for f in json/pass*.json; do
- if ! $RUNWITH -e 'local j=require"util.json" assert(j.decode(io.read("*a"))~=nil)' <"$f" 2>/dev/null; then
- echo "Failed to decode valid JSON: $f";
- FAIL=1
- fi
-done
-
-for f in json/fail*.json; do
- if ! $RUNWITH -e 'local j=require"util.json" assert(j.decode(io.read("*a"))==nil)' <"$f" 2>/dev/null; then
- echo "Invalid JSON decoded without error: $f";
- FAIL=1
- fi
-done
-
-if [ "$FAIL" == "1" ]; then
- echo "JSON tests failed"
- exit 1;
-fi
-
-exit 0;