nvm_format_version: add unit tests.

master
Jordan Harband 2014-09-29 01:34:50 -07:00
parent cd4fc8fb2c
commit 5706aef3d0
1 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,14 @@
#!/bin/sh
die () { echo $@ ; exit 1; }
. ../../../nvm.sh
OUTPUT="$(nvm_format_version 0.1.2)"
EXPECTED_OUTPUT="v0.1.2"
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm_format_version 0.1.2 did not return $EXPECTED_OUTPUT; got $OUTPUT"
OUTPUT="$(nvm_format_version 0.1)"
EXPECTED_OUTPUT="v0.1.0"
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm_format_version 0.1.0 did not return $EXPECTED_OUTPUT; got $OUTPUT"