From 66c06a8675c4d9894e5d0c650213ed96365c4f16 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 27 Jan 2020 13:37:41 +0300 Subject: Travis: add test_symlink_unlink_works --- .travis/test.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.travis/test.sh b/.travis/test.sh index 86fe75b..10aef24 100755 --- a/.travis/test.sh +++ b/.travis/test.sh @@ -258,6 +258,7 @@ test_symlink_update_works() { # Shared files can also be symlinks, pointing to something else. new_test + # Create a stupid symlink. ln -s -- 'bar/3.txt' "$test_src_dir/%DEST%/3_copy.txt" call_update @@ -276,7 +277,23 @@ $test_dest_dir/foo/2.txt->$test_src_dir/%DEST%/foo/2.txt" echo echo 'Verifying 3_copy.txt is valid...' readlink -e -- "$test_dest_dir/3_copy.txt" - cat "$test_dest_dir/3_copy.txt" + cat -- "$test_dest_dir/3_copy.txt" +} + +test_symlink_unlink_works() { + new_test + # Create a stupid symlink. + ln -s -- 'bar/3.txt' "$test_src_dir/%DEST%/3_copy.txt" + call_update + call_unlink + + local expected_output="$test_dest_dir->" + 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" } main() { @@ -290,6 +307,7 @@ main() { test_dir_symlink_remove_dir_symlink test_symlink_update_works + test_symlink_unlink_works } main -- cgit v1.2.3