From a95dbda385aeb1645eb7f65487d0be67c7a9de97 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 27 Jan 2020 14:08:13 +0300 Subject: Travis: test_symlink_*: actually do fail --- .travis/test.sh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.travis/test.sh b/.travis/test.sh index 7717062..e7bcd5a 100755 --- a/.travis/test.sh +++ b/.travis/test.sh @@ -275,9 +275,15 @@ $test_dest_dir/foo/2.txt->$test_src_dir/%DEST%/foo/2.txt" verify_output "$expected_output" echo - echo 'Verifying 3_copy.txt is valid...' - readlink -e -- "$test_dest_dir/3_copy.txt" - cat -- "$test_dest_dir/3_copy.txt" + echo 'Verifying 3_copy.txt (the symlink) is valid...' + + local copy_target + copy_target="$( readlink -- "$test_dest_dir/3_copy.txt" )" + test "$copy_target" = "$test_src_dir/%DEST%/3_copy.txt" + + local copy_content + copy_content="$( cat -- "$test_dest_dir/3_copy.txt" )" + test "$copy_content" = '3' } test_symlink_unlink_works() { @@ -291,9 +297,15 @@ test_symlink_unlink_works() { verify_output "$expected_output" echo - echo 'Verifying 3_copy.txt is valid...' - readlink -e -- "$test_src_dir/%DEST%/3_copy.txt" - cat -- "$test_src_dir/%DEST%/3_copy.txt" + echo 'Verifying 3_copy.txt (the shared file) is valid...' + + local copy_target + copy_target="$( readlink -e -- "$test_src_dir/%DEST%/3_copy.txt" )" + test "$copy_target" = "$test_src_dir/%DEST%/bar/3.txt" + + local copy_content + copy_content="$( cat -- "$test_src_dir/%DEST%/3_copy.txt" )" + test "$copy_content" = '3' } main() { -- cgit v1.2.3