Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions tests/copytests/cases/test031.sh

This file was deleted.

4 changes: 2 additions & 2 deletions tests/copytests/cases/test032.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# copy an empty directory to a non-existing directory with -r flag
# copy an empty directory to a non-existing directory
# ensure the empty directory is copied to one with the new name

set -e
cd "$HOME/testcp"
mkdir foo

wsh file copy -r foo bar
wsh file copy foo bar

if [ ! -d bar ]; then
echo "bar does not exist"
Expand Down
13 changes: 0 additions & 13 deletions tests/copytests/cases/test033.sh

This file was deleted.

4 changes: 2 additions & 2 deletions tests/copytests/cases/test034.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# copy an empty directory ending with / to a non-existing directory with -r flag
# copy an empty directory ending with / to a non-existing directory
# ensure the copy succeeds and the new directory exists

set -e
cd "$HOME/testcp"
mkdir bar

wsh file copy -r bar/ baz
wsh file copy bar/ baz
if [ ! -d baz ]; then
echo "baz does not exist"
exit 1
Expand Down
12 changes: 0 additions & 12 deletions tests/copytests/cases/test035.sh

This file was deleted.

4 changes: 2 additions & 2 deletions tests/copytests/cases/test036.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# copy an empty directory to a non-existing directory ending with / with -r flag
# copy an empty directory to a non-existing directory ending with /
# ensure the copy succeeds and the new directory exists

set -e
cd "$HOME/testcp"
mkdir bar

wsh file copy -r bar baz/
wsh file copy bar baz/

if [ ! -d baz ]; then
echo "baz does not exist"
Expand Down
4 changes: 2 additions & 2 deletions tests/copytests/cases/test037.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# copy an empty directory ending with // to a non-existing directory with -r flag
# copy an empty directory ending with // to a non-existing directory
# ensure the copy succeeds and the new directory exists

set -e
cd "$HOME/testcp"
mkdir bar

wsh file copy -r bar// baz
wsh file copy bar// baz

if [ ! -d baz ]; then
echo "baz does not exist"
Expand Down
4 changes: 2 additions & 2 deletions tests/copytests/cases/test038.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# copy an empty directory to a non-existing directory ending with // with -r flag
# copy an empty directory to a non-existing directory ending with //
# ensure the copy succeeds and the new directory exists

set -e
cd "$HOME/testcp"
mkdir bar

wsh file copy -r bar baz//
wsh file copy bar baz//

if [ ! -d baz ]; then
echo "baz does not exist"
Expand Down
14 changes: 0 additions & 14 deletions tests/copytests/cases/test039.sh

This file was deleted.

4 changes: 2 additions & 2 deletions tests/copytests/cases/test040.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# copy a directory containing a file to a new directory with -r flag
# copy a directory containing a file to a new directory
# ensure this succeeds and the new files exist

set -e
cd "$HOME/testcp"
mkdir bar
touch bar/foo.txt

wsh file copy -r bar baz
wsh file copy bar baz

if [ ! -f baz/foo.txt ]; then
echo "baz/foo.txt does not exist"
Expand Down
4 changes: 2 additions & 2 deletions tests/copytests/cases/test041.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# copy a directory containing a file to an existing directory with -r flag
# copy a directory containing a file to an existing directory
# ensure this succeeds and the new files are nested in the existing directory

set -e
Expand All @@ -7,7 +7,7 @@ mkdir bar
touch bar/foo.txt
mkdir baz

wsh file -r bar baz
wsh file copy bar baz

if [ ! -f baz/bar/foo.txt ]; then
echo "baz/bar/foo.txt does not exist"
Expand Down
4 changes: 2 additions & 2 deletions tests/copytests/cases/test042.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# copy a directory containing a file to an existing directory ending with / with -r flag
# copy a directory containing a file to an existing directory ending with /
# ensure this succeeds and the new files are nested in the existing directory

set -e
Expand All @@ -7,7 +7,7 @@ mkdir bar
touch bar/foo.txt
mkdir baz

wsh file copy -r bar baz/
wsh file copy bar baz/

if [ ! -f baz/bar/foo.txt ]; then
echo "baz/bar/foo.txt does not exist"
Expand Down
4 changes: 2 additions & 2 deletions tests/copytests/cases/test043.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# copy a directory containing a file to an existing directory ending with /. with -r flag
# copy a directory containing a file to an existing directory ending with /.
# ensure this succeeds and the new files are nested in the existing directory

set -e
Expand All @@ -7,7 +7,7 @@ mkdir bar
touch bar/foo.txt
mkdir baz

wsh file copy -r bar baz/.
wsh file copy bar baz/.

if [ ! -f baz/bar/foo.txt ]; then
echo "baz/bar/foo.txt does not exist"
Expand Down
4 changes: 2 additions & 2 deletions tests/copytests/cases/test044.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# copy a doubly nested directory containing a file to a non-existant directory with the -r flag
# copy a doubly nested directory containing a file to a non-existant directory
# ensure this succeeds and the new files exist with the first directory renamed

set -e
Expand All @@ -7,7 +7,7 @@ mkdir foo
mkdir foo/bar
touch foo/bar/baz.txt

wsh file copy -r foo qux
wsh file copy foo qux

if [ ! -f qux/bar/baz.txt ]; then
echo "qux/bar/baz.txt does not exist"
Expand Down
4 changes: 2 additions & 2 deletions tests/copytests/cases/test045.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# copy a doubly nested directory containing a file to an existing directory with the -r flag
# copy a doubly nested directory containing a file to an existing directory
# ensure this succeeds and the new files exist and are nested in the existing directory

set -e
Expand All @@ -8,7 +8,7 @@ mkdir foo/bar
touch foo/bar/baz.txt
mkdir qux

wsh file copy -r foo qux
wsh file copy foo qux

if [ ! -f qux/foo/bar/baz.txt ]; then
echo "qux/foo/bar/baz.txt does not exist"
Expand Down
16 changes: 0 additions & 16 deletions tests/copytests/cases/test048.sh

This file was deleted.

4 changes: 2 additions & 2 deletions tests/copytests/cases/test049.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# copy the current directory into an existing directory with the -r flag
# copy the current directory into an existing directory
# ensure the copy succeeds and the output exists

set -e
Expand All @@ -8,7 +8,7 @@ touch foo/bar.txt
mkdir baz
cd foo

wsh file copy -r . ../baz
wsh file copy . ../baz
cd ..

if [ ! -f baz/bar.txt ]; then
Expand Down
15 changes: 0 additions & 15 deletions tests/copytests/cases/test050.sh

This file was deleted.

4 changes: 2 additions & 2 deletions tests/copytests/cases/test051.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# copy the current directory into a non-existing directory with the -r flag
# copy the current directory into a non-existing directory
# ensure the copy succeeds and the output exists

set -e
Expand All @@ -7,7 +7,7 @@ mkdir foo
touch foo/bar.txt
cd foo

wsh file copy -r . ../baz
wsh file copy . ../baz
cd ..

if [ ! -f baz/bar.txt ]; then
Expand Down
2 changes: 1 addition & 1 deletion tests/copytests/cases/test052.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mkdir corge
# we need a nested corge/foo so the foo.zip contains the same exact file names
# in other words, if one file was named foo and the other was corge, they would
# not match. this allows them to be the same.
wsh file copy -r foo corge/foo
wsh file copy foo corge/foo


zip -r foo.zip foo >/dev/null 2>&1
Expand Down
13 changes: 11 additions & 2 deletions tests/copytests/runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,22 @@
cd "$(dirname "$0")"
source testutil.sh

TOTAL_COPY_TESTS_RUN=0
TOTAL_COPY_TESTS_PASSED=0

for fname in cases/*.sh; do
setup_testcp
#"${fname}" | read outerr && printf "\e[32mPASS $fname\n\n\e[0m" || printf "\e[31mFAIL $fname: $outerr \n\n\e[0m"
if ! outerr=$("${fname}" 2>&1); then
printf "\e[31mFAIL $fname:\n$outerr \n\n\e[0m"
printf "\e[31mFAIL $fname:\n$outerr \n\e[0m"
cat "${fname}"
printf "\n"
else
printf "\e[32mPASS $fname\n\n\e[0m"
((TOTAL_COPY_TESTS_PASSED++))
fi
cleanup_testcp
done
((TOTAL_COPY_TESTS_RUN++))
done

printf "\n\e[32m${TOTAL_COPY_TESTS_PASSED} of ${TOTAL_COPY_TESTS_RUN} Tests Passed \e[0m\n\n"
Loading