fix: add missing "does not add paths to PATH more than once" test for elvish (#1275)

This commit is contained in:
Elijah 2022-06-25 06:35:08 -05:00 committed by GitHub
parent f2d5d4890b
commit 3c55167a68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,6 +73,20 @@ cleaned_path() {
[[ "$output" =~ "<ns " ]]
}
@test "does not add paths to PATH more than once" {
result=$(elvish -norc -c "
unset-env ASDF_DIR
set paths = [$(cleaned_path)]
use asdftest _asdf; var asdf~ = \$_asdf:asdf~
use asdftest _asdf; var asdf~ = \$_asdf:asdf~
echo \$E:PATH
")
[ "$?" -eq 0 ]
output=$(echo $PATH | tr ':' '\n' | grep "asdf" | sort | uniq -d)
[ "$output" = "" ]
}
@test "defines the asdf function" {
output=$(elvish -norc -c "
unset-env ASDF_DIR