diff options
Diffstat (limited to 'test/tst-remove-does-not-overwrite-files.sh')
| -rw-r--r-- | test/tst-remove-does-not-overwrite-files.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/tst-remove-does-not-overwrite-files.sh b/test/tst-remove-does-not-overwrite-files.sh new file mode 100644 index 0000000..baef2ef --- /dev/null +++ b/test/tst-remove-does-not-overwrite-files.sh @@ -0,0 +1,20 @@ +test_run() { + # Check that if a user overwrites a symlink with his own file, links-remove + # keeps it. + + test_setup + test_run_update + + # Simulate a user overwriting one of the symlinks with his own file. + rm -- "$test_dest_dir/bar/3.txt" + echo 'User content' > "$test_dest_dir/bar/3.txt" + + test_run_remove + + # 3.txt must be kept: + local expected_output="$test_dest_dir-> +$test_dest_dir/bar-> +$test_dest_dir/bar/3.txt->" + + test_verify_output "$test_dest_dir" "$expected_output" +} |
