Debian Codegraph @

debian/tests/check-malformed

raw
1 #!/bin/sh
2 # do not use set -e because we expect an error code
3
4 if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
5 AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
6 # Double quote below to expand the temporary directory variable now versus
7 # later is on purpose.
8 # shellcheck disable=SC2064
9 trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
10 fi
11
12 cd "${AUTOPKGTEST_TMP}"
13
14 # run clearcut with no args, passing in empty content.
15 # This should return nonzero (malformed input)
16 echo "" | clearcut
17
18 if [ $? -ne 0 ] ; then
19 exit 0
20 else
21 exit 1
22 fi
23