3 $ [ -n "$TEST_BIN_DIR" ] && export PATH="$TEST_BIN_DIR:$PATH"
4 $ export TEST_INPUTS="$TESTDIR/inputs"
5 $ alias js="valgrind --quiet --leak-check=full test-json-script"
7 check that json-script is producing expected results:
10 Usage: test-json-script [VARNAME=value] <filename_json_script>
13 $ echo '}' > test.json; js test.json
14 load JSON data from test.json failed.
16 $ js nada.json 2>&1 | grep load.*failed
17 load JSON data from nada.json failed.
19 $ echo '[ [ ] [ ] ]' > test.json; js test.json
20 load JSON data from test.json failed.
22 check example json-script:
24 $ js $TEST_INPUTS/json-script.json
28 $ js EXECVAR=meh ORVAR=meep $TEST_INPUTS/json-script.json
43 $ js VAR=foo test.json
46 $ js VAR=bar test.json
57 > [ "eq", "VAR", "bar" ],
63 $ js VAR=bar test.json
66 $ js VAR=xxx test.json
72 check regex single expression:
77 > [ "regex", "VAR", ".ell." ],
83 $ js VAR=hello test.json
86 $ js VAR=.ell. test.json
95 $ js VAR=hell test.json