Add test for the resolve_symlink function.

This commit is contained in:
Trevor Brown 2018-10-07 20:21:48 -04:00
parent 64d4e145a1
commit 2bc679084f

View File

@ -268,3 +268,25 @@ teardown() {
[ "$status" -eq 0 ]
[ "$output" = "$PROJECT_DIR/.tool-versions" ]
}
@test "resolve_symlink converts the symlink path to the real file path" {
touch foo
ln -s $(pwd)/foo bar
run resolve_symlink bar
[ "$status" -eq 0 ]
echo $status
[ "$output" = $(pwd)/foo ]
rm -f foo bar
}
@test "resolve_symlink converts relative symlink path to the real file path" {
touch foo
ln -s foo bar
run resolve_symlink bar
[ "$status" -eq 0 ]
echo $status
[ "$output" = $(pwd)/foo ]
rm -f foo bar
}