Skip to content

Commit

Permalink
[Tests] add some WIP tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jan 12, 2020
1 parent 9222739 commit cf9beb7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/fast/Unit tests/nvm_tree_contains_path
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/sh

cleanup () {
rm tmp3/tmp2
rmdir tmp3
rm tmp/node
rmdir tmp
rm tmp2/node
Expand All @@ -14,6 +16,8 @@ mkdir -p tmp
touch tmp/node
mkdir -p tmp2
touch tmp2/node
mkdir -p tmp3
ln -s tmp2 tmp3/

[ "$(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'
Expand All @@ -28,4 +32,6 @@ nvm_tree_contains_path tmp2 tmp2/node || die '"tmp2" should contain "tmp2/node"'

nvm_tree_contains_path tmp2 tmp/node && die '"tmp2" should not contain "tmp/node"'

nvm_tree_contains_path tmp2 tmp3 && die 'no idea'

cleanup

0 comments on commit cf9beb7

Please sign in to comment.