[Originally from bubblewrap commits
c5c999a7 "tests: test --userns"
and
3e5fe1bf "tests: Better error message if assert_files_equal fails";
separated into this commit by Simon McVittie.]
fatal "$@"
}
+_fatal_print_files() {
+ file1="$1"
+ shift
+ file2="$1"
+ shift
+ ls -al "$file1" >&2
+ sed -e 's/^/# /' < "$file1" >&2
+ ls -al "$file2" >&2
+ sed -e 's/^/# /' < "$file2" >&2
+ fatal "$@"
+}
+
assert_not_has_file () {
if test -f "$1"; then
_fatal_print_file "$1" "File '$1' exists"
fi
}
+assert_files_equal() {
+ if ! cmp "$1" "$2"; then
+ _fatal_print_files "$1" "$2" "File '$1' and '$2' is not equal"
+ fi
+}
+
# Use to skip all of these tests
skip() {
echo "1..0 # SKIP" "$@"