mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-09-09 14:30:34 +00:00
Add error checking to nvm_tree_contains_path
This commit is contained in:
@@ -15,6 +15,11 @@ touch tmp/node
|
||||
mkdir -p tmp2
|
||||
touch tmp2/node
|
||||
|
||||
[ "$(nvm_tree_contains_path 2>&1)" = "both the tree and the node path are required" ] || die 'incorrect error message with no args'
|
||||
[ "$(nvm_tree_contains_path > /dev/null 2>&1 ; echo $?)" = "2" ] || die 'incorrect error code with no args'
|
||||
[ "$(nvm_tree_contains_path tmp 2>&1)" = "both the tree and the node path are required" ] || die 'incorrect error message with one arg'
|
||||
[ "$(nvm_tree_contains_path > /dev/null 2>&1 ; echo $?)" = "2" ] || die 'incorrect error code with one arg'
|
||||
|
||||
nvm_tree_contains_path tmp tmp/node || die '"tmp" should contain "tmp/node"'
|
||||
|
||||
nvm_tree_contains_path tmp tmp2/node && die '"tmp" should not contain "tmp2/node"'
|
||||
|
Reference in New Issue
Block a user