mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-10-11 00:00:13 +08:00
[Tests] add unit tests for nvm_version_greater_than_or_equal_to
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
die () { echo "$@" ; exit 1; }
|
||||
|
||||
: nvm.sh
|
||||
\. ../../../nvm.sh
|
||||
|
||||
nvm_version_greater_than_or_equal_to 0.10.0 0.2.12 || die '"nvm_version_greater_than_or_equal_to 0.10.0 0.2.12" did not return true'
|
||||
|
||||
nvm_version_greater_than_or_equal_to 0.10.0 0.10.0 || die '"nvm_version_greater_than_or_equal_to" did not return true for the same two versions'
|
||||
|
||||
nvm_version_greater_than_or_equal_to v0.10.0 0.10.0 || die '"nvm_version_greater_than_or_equal_to v0.10.0 0.10.0" did not return true'
|
||||
|
||||
if nvm_version_greater_than_or_equal_to 0.10.0 0.20.12; then
|
||||
die '"nvm_version_greater_than_or_equal_to 0.10.0 0.20.12" returned true'
|
||||
fi
|
||||
|
||||
if nvm_version_greater_than_or_equal_to 0.10.0 ''; then
|
||||
die '"nvm_version_greater_than_or_equal_to" returned true with an empty argument'
|
||||
fi
|
||||
Reference in New Issue
Block a user