#!/bin/sh

set -e

# shellcheck source=snap-confine/tests/common.sh
. "${srcdir:-.}/snap-confine/tests/common.sh"

cat >"$TMP/snap.name.app" <<EOF
# super strict filter
@complai
@complaim
@omplain
@COMPLAIN
complain
EOF

# ensure that the command "true" can not run due to impossible
# filtering

printf "Test that near misses of complain fail"
if "$L" snap.name.app /bin/true 2>/dev/null; then
    # true returned successfully, our filtering is broken!
    FAIL
else
    PASS
fi
