summaryrefslogtreecommitdiffstatshomepage
path: root/test/local/tst-remove-symlink.sh
blob: da6186727acd7ba6fdd381c3280284ca5c5ec2ae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
test_run() {
    # Verify that links-remove doesn't delete shared symlinks.

    test_setup_symlink
    test_run_update
    test_run_remove

    local expected_output="$test_dest_dir->"
    test_verify_output "$expected_output"

    echo
    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'
}