summaryrefslogtreecommitdiffstatshomepage
path: root/test/local/tst-remove-symlink.sh
blob: a8f768febc3bba2baa39bcd8889adae5b54baca9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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"

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