From d5e21be1648e8c9eeac2e04f592ea9051b01b345 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 13 Jan 2015 23:51:54 -0800 Subject: [PATCH] Add `nvm_ensure_version_prefix` unit tests. --- test/fast/Unit tests/nvm_ensure_version_prefix | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 test/fast/Unit tests/nvm_ensure_version_prefix diff --git a/test/fast/Unit tests/nvm_ensure_version_prefix b/test/fast/Unit tests/nvm_ensure_version_prefix new file mode 100755 index 0000000..72b301c --- /dev/null +++ b/test/fast/Unit tests/nvm_ensure_version_prefix @@ -0,0 +1,9 @@ +#!/bin/sh + +die () { echo $@ ; exit 1; } + +. ../../../nvm.sh + +[ "_$(nvm_ensure_version_prefix 1)" = "_v1" ] || die '"nvm_ensure_version_prefix 1" did not return "v1"' +[ "_$(nvm_ensure_version_prefix v1)" = "_v1" ] || die '"nvm_ensure_version_prefix v1" did not return "v1"' +[ "_$(nvm_ensure_version_prefix foo)" = "_foo" ] || die '"nvm_ensure_version_prefix foo" did not return "foo"'