From 6f5f41a8a87ac60de171e18e6d233f34f61c4454 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 17 Jun 2018 21:45:47 -0400 Subject: [PATCH] run-tests.sh: add tests for "./" and "../" as arguments, too. --- run-tests.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/run-tests.sh b/run-tests.sh index 06d2508..cb04d47 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -896,6 +896,20 @@ ACTUAL=$( getfacl --omit-header "./baz" ) popd > /dev/null compare +# Ensure that "./" works as an argument. +((TESTNUM++)) +TARGET="${TESTDIR}" +mkdir "${TARGET}/foo" +mkdir "${TARGET}/bar" +setfacl --default --modify user:${USERS[0]}:rw "${TARGET}" +"${BIN}" "${TARGET}/foo" +EXPECTED=$( getfacl --omit-header "${TARGET}/foo" ) +pushd "${TARGET}/bar" > /dev/null +"${BIN}" "./" +ACTUAL=$( getfacl --omit-header "./" ) +popd > /dev/null +compare + # Ensure that ".." works as an argument. ((TESTNUM++)) TARGET="${TESTDIR}" @@ -923,3 +937,17 @@ pushd "${TARGET}/bar/baz" > /dev/null ACTUAL=$( getfacl --omit-header "." ) popd > /dev/null compare + +# Ensure that "../" works as an argument. +((TESTNUM++)) +TARGET="${TESTDIR}" +mkdir "${TARGET}/foo" +mkdir -p "${TARGET}/bar/baz" +setfacl --default --modify user:${USERS[0]}:rw "${TARGET}" +"${BIN}" "${TARGET}/foo" +EXPECTED=$( getfacl --omit-header "${TARGET}/foo" ) +pushd "${TARGET}/bar/baz" > /dev/null +"${BIN}" "../" +ACTUAL=$( getfacl --omit-header "../" ) +popd > /dev/null +compare -- 2.44.2