Force symlink creation in realpath tests

If an earlier test was aborted, the symlink would still be present and
the subsequent run will fail to create the symlink as it wasn't forced.
This commit is contained in:
Mahmoud Al-Qudsi 2019-12-18 12:31:24 -06:00
parent e52433d6fe
commit d90d4f849c

View File

@ -52,7 +52,7 @@ builtin realpath .
popd popd
# A single symlink to a directory is correctly resolved. # A single symlink to a directory is correctly resolved.
ln -s fish $XDG_DATA_HOME/fish-symlink ln -fs fish $XDG_DATA_HOME/fish-symlink
set -l real_path (builtin realpath $XDG_DATA_HOME/fish-symlink) set -l real_path (builtin realpath $XDG_DATA_HOME/fish-symlink)
set -l expected_real_path "$data_home_realpath/fish" set -l expected_real_path "$data_home_realpath/fish"
if test "$real_path" = "$expected_real_path" if test "$real_path" = "$expected_real_path"
@ -74,9 +74,9 @@ else
end end
# A path with two symlinks, first to a directory, second to a file, is correctly resolved. # A path with two symlinks, first to a directory, second to a file, is correctly resolved.
ln -s fish $XDG_DATA_HOME/fish-symlink2 ln -fs fish $XDG_DATA_HOME/fish-symlink2
touch $XDG_DATA_HOME/fish/real_file touch $XDG_DATA_HOME/fish/real_file
ln -s real_file $XDG_DATA_HOME/fish/symlink_file ln -fs real_file $XDG_DATA_HOME/fish/symlink_file
set -l real_path (builtin realpath $XDG_DATA_HOME/fish-symlink/symlink_file) set -l real_path (builtin realpath $XDG_DATA_HOME/fish-symlink/symlink_file)
set -l expected_real_path "$data_home_realpath/fish/real_file" set -l expected_real_path "$data_home_realpath/fish/real_file"
if test "$real_path" = "$expected_real_path" if test "$real_path" = "$expected_real_path"