diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2020-01-27 13:37:41 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2020-01-27 13:41:25 +0300 |
commit | 66c06a8675c4d9894e5d0c650213ed96365c4f16 (patch) | |
tree | 01581c6670120b1c323b50d36cd7e0ff4aa619a9 | |
parent | Travis: expand test_symlink_update_works (diff) | |
download | config-links-66c06a8675c4d9894e5d0c650213ed96365c4f16.tar.gz config-links-66c06a8675c4d9894e5d0c650213ed96365c4f16.zip |
Travis: add test_symlink_unlink_works
-rwxr-xr-x | .travis/test.sh | 20 |
1 files changed, 19 insertions, 1 deletions
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 |