diff --git a/nvm.sh b/nvm.sh index 9683082..c6123ea 100755 --- a/nvm.sh +++ b/nvm.sh @@ -927,6 +927,10 @@ nvm_ensure_default_set() { return $EXIT_CODE } +nvm_is_merged_node_version() { + nvm_version_greater_than_or_equal_to "$1" v4.0.0 +} + nvm_install_iojs_binary() { local NVM_IOJS_TYPE NVM_IOJS_TYPE="$1" diff --git a/test/fast/Unit tests/nvm_is_merged_node_version b/test/fast/Unit tests/nvm_is_merged_node_version new file mode 100755 index 0000000..7cf5334 --- /dev/null +++ b/test/fast/Unit tests/nvm_is_merged_node_version @@ -0,0 +1,10 @@ +#!/bin/sh + +die () { echo $@ ; exit 1; } + +. ../../../nvm.sh + +nvm_is_merged_node_version '4.0' || die '"nvm_is_merged_node_version 4.0 was not true' +nvm_is_merged_node_version '5.1' || die '"nvm_is_merged_node_version 5.1 was not true' +! nvm_is_merged_node_version '3.99' || die '"nvm_is_merged_node_version 3.99 was not false' +! nvm_is_merged_node_version 'v1.0.0' || die '"nvm_is_merged_node_version v1.0.0" was not false'