#!/bin/sh cd $(0%/*) setglobal INPUT = './solidus/string_with_solidus.json' setglobal OUTPUT_ESCAPED = './solidus/string_with_solidus.with-escaping.parsed' setglobal OUTPUT_WITHOUT_ESCAPING = './solidus/string_with_solidus.no-escaping.parsed' setglobal FAILS = '0' echo "1..2" if ! ../JSON.sh < $INPUT| diff -u - $(OUTPUT_ESCAPED) { echo "not ok - JSON.sh run without -s option should leave solidus escaping intact" setglobal FAILS = $shExpr('FAILS + 1') } else { echo "ok $i - solidus escaping was left intact" } if ! ../JSON.sh -s < $INPUT| diff -u - $(OUTPUT_WITHOUT_ESCAPING) { echo "not ok - JSON.sh run with -s option should remove solidus escaping" setglobal FAILS = $shExpr('FAILS+1') } else { echo "ok $i - solidus escaping has been removed" } echo "$FAILS test(s) failed" exit $FAILS