diff --git a/test/fast/Sourcing nvm.sh should set MANPATH correctly. b/test/fast/Sourcing nvm.sh should set MANPATH correctly. new file mode 100755 index 0000000..b2816f2 --- /dev/null +++ b/test/fast/Sourcing nvm.sh should set MANPATH correctly. @@ -0,0 +1,14 @@ +#!/bin/sh +mkdir -p ../../v0.10.26/share/man +echo v0.10.26 >../../alias/default + +T_NVM_DIR=$(pwd) +T_NVM_DIR=${T_NVM_DIR%/test/fast} + +T_MANPATH=`manpath` +T_MANPATH=`echo ${T_MANPATH} | awk -v RS=: -v ORS=: "/${T_NVM_DIR//\//\\/}/ "'{next} {print}' | sed 's/:*$//'` + +. ../../nvm.sh + +#The nvm entry should be the first one of MANPATH and remain other entries exist. +[ `expr "$MANPATH" : ".*$NVM_DIR/.*/share/man"` != 0 ] && [ "${MANPATH#*$NVM_DIR/*/man:}" = "${T_MANPATH}" ]