tests: use -z / -n to test for string empty / non-empty
[babeltrace.git] / tests / plugins / src.ctf.fs / fail / test_fail
index a3526d1dd0229f2d88c63f91ec604a928bc2232f..1c75a0d28a6391fafa48ffe390b6075cb908732d 100755 (executable)
@@ -10,7 +10,7 @@
 
 SH_TAP=1
 
-if [ "x${BT_TESTS_SRCDIR:-}" != "x" ]; then
+if [ -n "${BT_TESTS_SRCDIR:-}" ]; then
        UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh"
 else
        UTILSSH="$(dirname "$0")/../../../utils/utils.sh"
@@ -49,7 +49,7 @@ test_fail() {
 }
 
 
-plan_tests 8
+plan_tests 12
 
 test_fail \
        "invalid-packet-size/trace" \
@@ -61,4 +61,9 @@ test_fail \
        "${data_dir}/valid-events-then-invalid-events.expect" \
        "No event class with ID of event class ID to use in stream class: .*stream-class-id=0, event-class-id=255"
 
+test_fail \
+       "metadata-syntax-error" \
+       "/dev/null" \
+       "^  At line 3 in metadata stream: syntax error, unexpected CTF_RSBRAC: token=\"]\""
+
 rm -f "${stdout_file}" "${stderr_file}"
This page took 0.027299 seconds and 4 git commands to generate.