diff options
| author | Egor Tensin <egor@tensin.name> | 2026-09-27 15:37:44 +0500 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-09-27 15:37:44 +0500 |
| commit | 516f8693c2c9dd4fd4c9294ee81f4d5599fe3524 (patch) | |
| tree | 40dff6aa2f0c5b5f5a663cbdf33db00682b9283c /test/local | |
| parent | test: move the linux-home test to test/local/ (diff) | |
| download | config-links-516f8693c2c9dd4fd4c9294ee81f4d5599fe3524.tar.gz config-links-516f8693c2c9dd4fd4c9294ee81f4d5599fe3524.zip | |
test/local/ -> test/
Diffstat (limited to 'test/local')
| -rw-r--r-- | test/local/data/dest/1.txt | 1 | ||||
| -rw-r--r-- | test/local/data/dest/bar/3.txt | 1 | ||||
| -rw-r--r-- | test/local/data/src/%DEST%/1.txt | 1 | ||||
| -rw-r--r-- | test/local/data/src/%DEST%/bar/3.txt | 1 | ||||
| -rw-r--r-- | test/local/data/src/%DEST%/bar/baz/4.txt | 1 | ||||
| -rw-r--r-- | test/local/data/src/%DEST%/foo/2.txt | 1 | ||||
| -rw-r--r-- | test/local/lib/log.sh | 128 | ||||
| -rw-r--r-- | test/local/lib/test.sh | 123 | ||||
| -rwxr-xr-x | test/local/main.sh | 79 | ||||
| -rw-r--r-- | test/local/tst-chmod.sh | 22 | ||||
| -rw-r--r-- | test/local/tst-dir-symlink-delete.sh | 25 | ||||
| -rw-r--r-- | test/local/tst-dir-symlink-remove-shared-file.sh | 30 | ||||
| -rw-r--r-- | test/local/tst-linux-home.sh | 42 | ||||
| -rw-r--r-- | test/local/tst-remove-dir-symlink.sh | 13 | ||||
| -rw-r--r-- | test/local/tst-remove-does-not-delete-user-dirs.sh | 19 | ||||
| -rw-r--r-- | test/local/tst-remove-does-not-overwrite-files.sh | 20 | ||||
| -rw-r--r-- | test/local/tst-remove-symlink.sh | 20 | ||||
| -rw-r--r-- | test/local/tst-remove.sh | 11 | ||||
| -rw-r--r-- | test/local/tst-update-chmod.sh | 19 | ||||
| -rw-r--r-- | test/local/tst-update-dir-symlink.sh | 29 | ||||
| -rw-r--r-- | test/local/tst-update-symlink.sh | 28 | ||||
| -rw-r--r-- | test/local/tst-update.sh | 18 |
22 files changed, 0 insertions, 632 deletions
diff --git a/test/local/data/dest/1.txt b/test/local/data/dest/1.txt deleted file mode 100644 index 3a2e3f4..0000000 --- a/test/local/data/dest/1.txt +++ /dev/null @@ -1 +0,0 @@ --1 diff --git a/test/local/data/dest/bar/3.txt b/test/local/data/dest/bar/3.txt deleted file mode 100644 index a83d1d5..0000000 --- a/test/local/data/dest/bar/3.txt +++ /dev/null @@ -1 +0,0 @@ --3 diff --git a/test/local/data/src/%DEST%/1.txt b/test/local/data/src/%DEST%/1.txt deleted file mode 100644 index d00491f..0000000 --- a/test/local/data/src/%DEST%/1.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/test/local/data/src/%DEST%/bar/3.txt b/test/local/data/src/%DEST%/bar/3.txt deleted file mode 100644 index 00750ed..0000000 --- a/test/local/data/src/%DEST%/bar/3.txt +++ /dev/null @@ -1 +0,0 @@ -3 diff --git a/test/local/data/src/%DEST%/bar/baz/4.txt b/test/local/data/src/%DEST%/bar/baz/4.txt deleted file mode 100644 index b8626c4..0000000 --- a/test/local/data/src/%DEST%/bar/baz/4.txt +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/test/local/data/src/%DEST%/foo/2.txt b/test/local/data/src/%DEST%/foo/2.txt deleted file mode 100644 index 0cfbf08..0000000 --- a/test/local/data/src/%DEST%/foo/2.txt +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/test/local/lib/log.sh b/test/local/lib/log.sh deleted file mode 100644 index b26e16a..0000000 --- a/test/local/lib/log.sh +++ /dev/null @@ -1,128 +0,0 @@ -# Copyright (c) 2026 Egor Tensin <egor@tensin.name> -# This file is part of the "config-links" project. -# For details, see https://github.com/egor-tensin/config-links -# Distributed under the MIT License. - -log() { - local msg - for msg; do - echo -e "$test_file | $msg" >&2 - done -} - -fail() { - local msg - for msg; do - log "FAIL: $msg" - done -} - -fail_details() { - local msg - for msg; do - fail " $msg" - done -} - -log_numof_tests_ok=0 -log_numof_tests_failed=0 -declare -a log_tests_failed=() -declare -A log_tests_should_fail=() - -log_test_start() { - if [ "$#" -ne 1 ]; then - echo "usage: ${FUNCNAME[0]} TEST_FILE" >&2 - return 1 - fi - - local test_file="$1" - - if [ -n "${test_should_fail:-}" ]; then - log_tests_should_fail["$test_file"]=1 - fi - - cat <<EOF >&2 - -====================================================================== -TEST: $test_file -====================================================================== -EOF - - log "Should fail: ${test_should_fail:-No}" -} - -log_test_ok() { - if [ "$#" -ne 1 ]; then - echo "usage: ${FUNCNAME[0]} TEST_FILE" >&2 - return 1 - fi - - log_numof_tests_ok=$((log_numof_tests_ok + 1)) - - cat <<EOF >&2 ----------------------------------------------------------------------- -OK: $1 ----------------------------------------------------------------------- -EOF -} - -log_test_fail() { - if [ "$#" -ne 1 ]; then - echo "usage: ${FUNCNAME[0]} TEST_FILE" >&2 - return 1 - fi - - log_numof_tests_failed=$((log_numof_tests_failed + 1)) - log_tests_failed+=("$1") - - cat <<EOF >&2 ----------------------------------------------------------------------- -FAIL: $1 ----------------------------------------------------------------------- -EOF -} - -log_test_finish() { - if [ "$#" -ne 2 ]; then - echo "usage: ${FUNCNAME[0]} TEST_FILE EXIT_CODE" >&2 - return 1 - fi - - local test_file="$1" - local ret="$2" - local test_should_fail - test_should_fail="${log_tests_should_fail["$test_file"]:+x}" - - if [ "$ret" -eq 0 ] || [ -n "$test_should_fail" ]; then - log_test_ok "$test_file" - else - log_test_fail "$test_file" - fi -} - -log_tests_summary() { - cat <<EOF >&2 - -====================================================================== -SUMMARY -====================================================================== -OK: $log_numof_tests_ok -FAIL: $log_numof_tests_failed -EOF - - local test_file - for test_file in ${log_tests_failed[@]+"${log_tests_failed[@]}"}; do - cat <<EOF >&2 -FAIL: $test_file -EOF - done - - cat <<EOF >&2 ----------------------------------------------------------------------- -EOF - - local ret=0 - [ "$log_numof_tests_failed" -gt 0 ] && ret=1 - - return "$ret" -} diff --git a/test/local/lib/test.sh b/test/local/lib/test.sh deleted file mode 100644 index 43cf55b..0000000 --- a/test/local/lib/test.sh +++ /dev/null @@ -1,123 +0,0 @@ -# Copyright (c) 2026 Egor Tensin <egor@tensin.name> -# This file is part of the "config-links" project. -# For details, see https://github.com/egor-tensin/config-links -# Distributed under the MIT License. - -test_should_fail= - -src_dir_name='src' -dest_dir_name='dest' -alt_dest_dir_name='alt_dest' - -test_root_dir= -test_src_dir= -test_dest_dir= -test_alt_dest_dir= - -test_setup() { - test_root_dir="$( mktemp -d )" - # mktemp returns /var/..., which is actually in /private/var/... on macOS. - test_root_dir="$( readlink -e -- "$test_root_dir" )" - - test_src_dir="$test_root_dir/$src_dir_name" - test_dest_dir="$test_root_dir/$dest_dir_name" - test_alt_dest_dir="$test_root_dir/$alt_dest_dir_name" - - log "Root directory: $test_root_dir" - log "Shared directory: $test_src_dir" - log "%DEST% directory: $test_dest_dir" - log "%ALT_DEST% directory: $test_alt_dest_dir" - - cp -r -- "$script_dir/data/$src_dir_name" "$test_src_dir" - cp -r -- "$script_dir/data/$dest_dir_name" "$test_dest_dir" - cp -r -- "$script_dir/data/$dest_dir_name" "$test_alt_dest_dir" -} - -test_setup_symlink() { - test_setup - - # Create a stupid symlink. - ln -s -- 'bar/3.txt' "$test_src_dir/%DEST%/3_copy.txt" -} - -test_setup_dir_symlink() { - test_setup - - # Files will get symlinks in the directory pointed to by $DEST, as well as - # by $ALT_DEST. - ln -s -- '%DEST%' "$test_src_dir/%ALT_DEST%" -} - -test_cleanup_default() { - if [ -n "$test_root_dir" ]; then - log "Removing test's root directory: $test_root_dir" - rm -rf -- "$test_root_dir" - fi -} - -test_run_script() { - local msg='Executing script:' - msg="$msg$( printf -- ' %q' "$@" --shared-dir "$test_src_dir" --database "$test_root_dir/links.bin" )" - log "$msg" - - DEST="$test_dest_dir" ALT_DEST="$test_alt_dest_dir" "$@" \ - --shared-dir "$test_src_dir" \ - --database "$test_root_dir/links.bin" -} - -test_run_update() { - test_run_script "$script_dir/../../bin/links-update" "$@" -} - -test_run_remove() { - test_run_script "$script_dir/../../bin/links-remove" -} - -test_run_chmod() { - test_run_script "$script_dir/../../bin/links-chmod" "$@" -} - -test_verify_output() { - if [ "$#" -lt 1 ] || [ "$#" -gt 2 ]; then - echo "usage: ${FUNCNAME[0]} DEST_DIR EXPECTED_OUTPUT" >&2 - return 1 - fi - - local dest_dir="$1" - local expected_output="$2" - - log "Verifying directory structure in $dest_dir..." - - local actual_output - actual_output="$( find "$dest_dir" -printf '%h/%f->%l\n' | sort )" - - if [ "$actual_output" != "$expected_output" ]; then - fail "The actual files do not match the expected directory structure!" - fail_details "Expected:\n$expected_output" - fail_details "Actual:\n$actual_output" - return 1 - fi -} - -test_verify_mode() { - if [ "$#" -ne 2 ]; then - echo "usage: ${FUNCNAME[0]} PATH EXPECTED_MODE" >&2 - return 1 - fi - - local path="$1" - local expected_mode="$2" - - log "Checking permissions for file: $path" - - local actual_mode - actual_mode="$( stat -c '%a' -- "$path" )" - actual_mode="0$actual_mode" - - if [ "$actual_mode" != "$expected_mode" ]; then - fail "They don't match" - fail_details "Expected: $expected_mode" - fail_details "Actual: $actual_mode" - return 1 - fi -} diff --git a/test/local/main.sh b/test/local/main.sh deleted file mode 100755 index 52b19ad..0000000 --- a/test/local/main.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (c) 2026 Egor Tensin <egor@tensin.name> -# This file is part of the "config-links" project. -# For details, see https://github.com/egor-tensin/config-links -# Distributed under the MIT License. - -set -o errexit -o nounset -o pipefail -shopt -s inherit_errexit 2> /dev/null || true -shopt -s lastpipe - -script_dir="$( dirname -- "${BASH_SOURCE[0]}" )" -script_dir="$( cd -- "$script_dir" && pwd )" -readonly script_dir -script_name="$( basename -- "${BASH_SOURCE[0]}" )" -readonly script_name - -source "$script_dir/lib/log.sh" - -run_test_file() { - local test_file - for test_file; do - source "$script_dir/lib/test.sh" - source "$script_dir/$test_file" - - log_test_start "$test_file" - - set +e - ( - set -o errexit -o nounset -o pipefail - shopt -s inherit_errexit 2> /dev/null || true - shopt -s lastpipe - - if [ "$( type -t test_cleanup )" == function ]; then - trap test_cleanup EXIT - else - trap test_cleanup_default EXIT - fi - - test_run - ) - local ret="$?" - set -e - - log_test_finish "$test_file" "$ret" - done -} - -main() { - if [ "$#" -gt 1 ]; then - echo "usage: $script_name [PATTERN]" >&2 - return 1 - fi - - local -a test_files=() - local test_file - - local pattern='*' - [ "$#" -gt 0 ] && pattern="$1" - - find "$script_dir" \ - -mindepth 1 \ - -maxdepth 1 \ - -type f \ - -regex '.*/tst-.*\.sh$' \ - -regextype posix-basic \ - -name "$pattern" \ - -printf '%P\0' \ - | sort -z \ - | \ - while IFS= read -d '' -r test_file; do - test_files+=("$test_file") - done - - run_test_file ${test_files[@]+"${test_files[@]}"} - log_tests_summary -} - -main "$@" diff --git a/test/local/tst-chmod.sh b/test/local/tst-chmod.sh deleted file mode 100644 index b118e5e..0000000 --- a/test/local/tst-chmod.sh +++ /dev/null @@ -1,22 +0,0 @@ -test_run() { - # Test that links-chmod works. - - test_setup - test_run_update - - local expected_output="$test_dest_dir-> -$test_dest_dir/1.txt->$test_src_dir/%DEST%/1.txt -$test_dest_dir/bar-> -$test_dest_dir/bar/3.txt->$test_src_dir/%DEST%/bar/3.txt -$test_dest_dir/bar/baz-> -$test_dest_dir/bar/baz/4.txt->$test_src_dir/%DEST%/bar/baz/4.txt -$test_dest_dir/foo-> -$test_dest_dir/foo/2.txt->$test_src_dir/%DEST%/foo/2.txt" - test_verify_output "$test_dest_dir" "$expected_output" - - log "Verifying 1.txt's (the shared file) permissions..." - - test_verify_mode "$test_src_dir/%DEST%/1.txt" 0644 - test_run_chmod 0600 - test_verify_mode "$test_src_dir/%DEST%/1.txt" 0600 -} diff --git a/test/local/tst-dir-symlink-delete.sh b/test/local/tst-dir-symlink-delete.sh deleted file mode 100644 index f53d87c..0000000 --- a/test/local/tst-dir-symlink-delete.sh +++ /dev/null @@ -1,25 +0,0 @@ -test_run() { - # If we remove a directory symlink in --shared-dir, all the symlinks - # accessible through this directory symlink should be removed. - - test_setup_dir_symlink - test_run_update - - # Remove the directory symlink: - rm -- "$test_src_dir/%ALT_DEST%" - test_run_update - - local expected_output="$test_dest_dir-> -$test_dest_dir/1.txt->$test_src_dir/%DEST%/1.txt -$test_dest_dir/bar-> -$test_dest_dir/bar/3.txt->$test_src_dir/%DEST%/bar/3.txt -$test_dest_dir/bar/baz-> -$test_dest_dir/bar/baz/4.txt->$test_src_dir/%DEST%/bar/baz/4.txt -$test_dest_dir/foo-> -$test_dest_dir/foo/2.txt->$test_src_dir/%DEST%/foo/2.txt" - - test_verify_output "$test_dest_dir" "$expected_output" - - expected_output="$test_alt_dest_dir->" - test_verify_output "$test_alt_dest_dir" "$expected_output" -} diff --git a/test/local/tst-dir-symlink-remove-shared-file.sh b/test/local/tst-dir-symlink-remove-shared-file.sh deleted file mode 100644 index 3e20ab0..0000000 --- a/test/local/tst-dir-symlink-remove-shared-file.sh +++ /dev/null @@ -1,30 +0,0 @@ -test_run() { - # If we remove a shared file, both of the symlinks should be removed. - - test_setup_dir_symlink - test_run_update - - # Remove a random shared file: - rm -- "$test_src_dir/%DEST%/bar/3.txt" - test_run_update - - local expected_output="$test_dest_dir-> -$test_dest_dir/1.txt->$test_src_dir/%DEST%/1.txt -$test_dest_dir/bar-> -$test_dest_dir/bar/baz-> -$test_dest_dir/bar/baz/4.txt->$test_src_dir/%DEST%/bar/baz/4.txt -$test_dest_dir/foo-> -$test_dest_dir/foo/2.txt->$test_src_dir/%DEST%/foo/2.txt" - - test_verify_output "$test_dest_dir" "$expected_output" - - expected_output="$test_alt_dest_dir-> -$test_alt_dest_dir/1.txt->$test_src_dir/%ALT_DEST%/1.txt -$test_alt_dest_dir/bar-> -$test_alt_dest_dir/bar/baz-> -$test_alt_dest_dir/bar/baz/4.txt->$test_src_dir/%ALT_DEST%/bar/baz/4.txt -$test_alt_dest_dir/foo-> -$test_alt_dest_dir/foo/2.txt->$test_src_dir/%ALT_DEST%/foo/2.txt" - - test_verify_output "$test_alt_dest_dir" "$expected_output" -} diff --git a/test/local/tst-linux-home.sh b/test/local/tst-linux-home.sh deleted file mode 100644 index 4d099ee..0000000 --- a/test/local/tst-linux-home.sh +++ /dev/null @@ -1,42 +0,0 @@ -[ -z "${CI+y}" ] && test_should_fail=y - -test_run() { - if [ -z "${CI+y}" ]; then - fail "Don't run this test locally, it'll mess up your \$HOME" - return 1 - fi - - readonly src_name=linux-home - src_url="https://github.com/egor-tensin/$src_name.git" - readonly src_url - - test_root_dir="$( mktemp -d )" - # mktemp returns /var/..., which is actually in /private/var/... on macOS. - test_root_dir="$( readlink -e -- "$test_root_dir" )" - - test_src_dir="$test_root_dir/$src_name" - - log "Cloning $src_url to $test_src_dir..." - git clone -q -- "$src_url" "$test_src_dir" - - test_run_update - # Again: - test_run_update - - log "Checking a couple of well-known files..." - local file - for file in .gitconfig .ssh/config; do - local actual - actual="$( readlink -e -- "$HOME/$file" )" - - local expected - expected="$test_src_dir/%HOME%/$file" - - if [ "$actual" != "$expected" ]; then - fail "There was a problem with symlink $file:" - fail_details "Expected target: $expected" - fail_details "Actual target: $actual" - return 1 - fi - done -} diff --git a/test/local/tst-remove-dir-symlink.sh b/test/local/tst-remove-dir-symlink.sh deleted file mode 100644 index c524ee6..0000000 --- a/test/local/tst-remove-dir-symlink.sh +++ /dev/null @@ -1,13 +0,0 @@ -test_run() { - # Test that links-remove works for directory symlinks inside --shared-dir. - - test_setup_dir_symlink - test_run_update - test_run_remove - - local expected_output="$test_dest_dir->" - test_verify_output "$test_dest_dir" "$expected_output" - - expected_output="$test_alt_dest_dir->" - test_verify_output "$test_alt_dest_dir" "$expected_output" -} diff --git a/test/local/tst-remove-does-not-delete-user-dirs.sh b/test/local/tst-remove-does-not-delete-user-dirs.sh deleted file mode 100644 index aa013c8..0000000 --- a/test/local/tst-remove-does-not-delete-user-dirs.sh +++ /dev/null @@ -1,19 +0,0 @@ -test_run() { - # Check that if a user adds a file to a destination directory, it's not - # deleted by links-remove. - - test_setup - test_run_update - - # User adds his own file to the directory: - echo 'User content' > "$test_dest_dir/bar/my-file" - - test_run_remove - - # bar/ and bar/my-file must be kept: - local expected_output="$test_dest_dir-> -$test_dest_dir/bar-> -$test_dest_dir/bar/my-file->" - - test_verify_output "$test_dest_dir" "$expected_output" -} diff --git a/test/local/tst-remove-does-not-overwrite-files.sh b/test/local/tst-remove-does-not-overwrite-files.sh deleted file mode 100644 index baef2ef..0000000 --- a/test/local/tst-remove-does-not-overwrite-files.sh +++ /dev/null @@ -1,20 +0,0 @@ -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" -} diff --git a/test/local/tst-remove-symlink.sh b/test/local/tst-remove-symlink.sh deleted file mode 100644 index aa27435..0000000 --- a/test/local/tst-remove-symlink.sh +++ /dev/null @@ -1,20 +0,0 @@ -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 "$test_dest_dir" "$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' -} diff --git a/test/local/tst-remove.sh b/test/local/tst-remove.sh deleted file mode 100644 index c79a3b4..0000000 --- a/test/local/tst-remove.sh +++ /dev/null @@ -1,11 +0,0 @@ -test_run() { - # Basic test to make sure links-remove actually removes the created - # symlinks. - - test_setup - test_run_update - test_run_remove - - local expected_output="$test_dest_dir->" - test_verify_output "$test_dest_dir" "$expected_output" -} diff --git a/test/local/tst-update-chmod.sh b/test/local/tst-update-chmod.sh deleted file mode 100644 index a78ee15..0000000 --- a/test/local/tst-update-chmod.sh +++ /dev/null @@ -1,19 +0,0 @@ -test_run() { - # Test that links-update --mode works. - - test_setup - local expected_mode='0622' - test_run_update --mode "$expected_mode" - - local expected_output="$test_dest_dir-> -$test_dest_dir/1.txt->$test_src_dir/%DEST%/1.txt -$test_dest_dir/bar-> -$test_dest_dir/bar/3.txt->$test_src_dir/%DEST%/bar/3.txt -$test_dest_dir/bar/baz-> -$test_dest_dir/bar/baz/4.txt->$test_src_dir/%DEST%/bar/baz/4.txt -$test_dest_dir/foo-> -$test_dest_dir/foo/2.txt->$test_src_dir/%DEST%/foo/2.txt" - - test_verify_output "$test_dest_dir" "$expected_output" - test_verify_mode "$test_src_dir/%DEST%/1.txt" "$expected_mode" -} diff --git a/test/local/tst-update-dir-symlink.sh b/test/local/tst-update-dir-symlink.sh deleted file mode 100644 index 27418ab..0000000 --- a/test/local/tst-update-dir-symlink.sh +++ /dev/null @@ -1,29 +0,0 @@ -test_run() { - # We can symlink files to multiple directories by creating symlinks inside - # --shared-dir. - - test_setup_dir_symlink - test_run_update - - local expected_output="$test_dest_dir-> -$test_dest_dir/1.txt->$test_src_dir/%DEST%/1.txt -$test_dest_dir/bar-> -$test_dest_dir/bar/3.txt->$test_src_dir/%DEST%/bar/3.txt -$test_dest_dir/bar/baz-> -$test_dest_dir/bar/baz/4.txt->$test_src_dir/%DEST%/bar/baz/4.txt -$test_dest_dir/foo-> -$test_dest_dir/foo/2.txt->$test_src_dir/%DEST%/foo/2.txt" - - test_verify_output "$test_dest_dir" "$expected_output" - - expected_output="$test_alt_dest_dir-> -$test_alt_dest_dir/1.txt->$test_src_dir/%ALT_DEST%/1.txt -$test_alt_dest_dir/bar-> -$test_alt_dest_dir/bar/3.txt->$test_src_dir/%ALT_DEST%/bar/3.txt -$test_alt_dest_dir/bar/baz-> -$test_alt_dest_dir/bar/baz/4.txt->$test_src_dir/%ALT_DEST%/bar/baz/4.txt -$test_alt_dest_dir/foo-> -$test_alt_dest_dir/foo/2.txt->$test_src_dir/%ALT_DEST%/foo/2.txt" - - test_verify_output "$test_alt_dest_dir" "$expected_output" -} diff --git a/test/local/tst-update-symlink.sh b/test/local/tst-update-symlink.sh deleted file mode 100644 index 6a90491..0000000 --- a/test/local/tst-update-symlink.sh +++ /dev/null @@ -1,28 +0,0 @@ -test_run() { - # Shared files can also be symlinks, pointing to something else. - - test_setup_symlink - test_run_update - - local expected_output="$test_dest_dir-> -$test_dest_dir/1.txt->$test_src_dir/%DEST%/1.txt -$test_dest_dir/3_copy.txt->$test_src_dir/%DEST%/3_copy.txt -$test_dest_dir/bar-> -$test_dest_dir/bar/3.txt->$test_src_dir/%DEST%/bar/3.txt -$test_dest_dir/bar/baz-> -$test_dest_dir/bar/baz/4.txt->$test_src_dir/%DEST%/bar/baz/4.txt -$test_dest_dir/foo-> -$test_dest_dir/foo/2.txt->$test_src_dir/%DEST%/foo/2.txt" - - test_verify_output "$test_dest_dir" "$expected_output" - - log 'Verifying 3_copy.txt (the symlink) is valid...' - - local copy_target - copy_target="$( readlink -- "$test_dest_dir/3_copy.txt" )" - test "$copy_target" = "$test_src_dir/%DEST%/3_copy.txt" - - local copy_content - copy_content="$( cat -- "$test_dest_dir/3_copy.txt" )" - test "$copy_content" = '3' -} diff --git a/test/local/tst-update.sh b/test/local/tst-update.sh deleted file mode 100644 index f33b929..0000000 --- a/test/local/tst-update.sh +++ /dev/null @@ -1,18 +0,0 @@ -test_run() { - # Basic test to make sure that links-update actually creates the proper - # symlinks. - - test_setup - test_run_update - - local expected_output="$test_dest_dir-> -$test_dest_dir/1.txt->$test_src_dir/%DEST%/1.txt -$test_dest_dir/bar-> -$test_dest_dir/bar/3.txt->$test_src_dir/%DEST%/bar/3.txt -$test_dest_dir/bar/baz-> -$test_dest_dir/bar/baz/4.txt->$test_src_dir/%DEST%/bar/baz/4.txt -$test_dest_dir/foo-> -$test_dest_dir/foo/2.txt->$test_src_dir/%DEST%/foo/2.txt" - - test_verify_output "$test_dest_dir" "$expected_output" -} |
