From e0b98198595ecb45e11d401c0b5f937028c3debe Mon Sep 17 00:00:00 2001 From: Ethan P Date: Tue, 21 Jan 2020 09:58:26 -0800 Subject: [PATCH] Add relative symlink test --- test/tests/symlink.relative.sh | 16 ++++++++++++++++ test/tests/symlink.relative.snapshot | 5 +++++ 2 files changed, 21 insertions(+) create mode 100644 test/tests/symlink.relative.sh create mode 100644 test/tests/symlink.relative.snapshot diff --git a/test/tests/symlink.relative.sh b/test/tests/symlink.relative.sh new file mode 100644 index 0000000..8bbcd33 --- /dev/null +++ b/test/tests/symlink.relative.sh @@ -0,0 +1,16 @@ +set -e + +# Create symlink. +templink="$(basename "$0" ".sh")._temp" +tempabs="$(pwd)/${templink}" +ln -s "../../src/batgrep.sh" "$templink" +chmod +x "$templink" + +# Run symlink. +export PATH="$(pwd):$PATH" +cd /tmp +"$(basename "$templink")" "templink" "${BASH_SOURCE[0]}" -C 0 | sed '1d;$d' || true + +# Cleanup. +rm "$tempabs" + diff --git a/test/tests/symlink.relative.snapshot b/test/tests/symlink.relative.snapshot new file mode 100644 index 0000000..afb3d77 --- /dev/null +++ b/test/tests/symlink.relative.snapshot @@ -0,0 +1,5 @@ +templink="$(basename "$0" ".sh")._temp" +tempabs="$(pwd)/${templink}" +ln -s "../../src/batgrep.sh" "$templink" +chmod +x "$templink" +"$(basename "$templink")" "templink" "${BASH_SOURCE[0]}" -C 0 | sed '1d;$d' || true