##############################################################################
#   Modules Revision 3.2.8
#   Providing a flexible user environment
#
#   First Edition:	2010/09/13
#
#   Authors:		R.K. Owen, rk@owen.sj.ca.us
#
#   Description:	Deep modulefile directories - display
#
##############################################################################

set p		"$modpathre/"

set lmf		"setenv _LMFILES_ "
set lm		"setenv LOADEDMODULES "
set mp		"setenv MODULEPATH "
set stt		"setenv TEST "
set stts	"setenv TESTS "
set nl		"\n$modlin"

set mw		":\n\nmodule-whatis\[ \t\]+"
set cf		"\nconflict\[ \t\]+"
set sv		"\nsetenv\[ \t\]+TEST\[ \t\]+"
set svs		"\nsetenv\[ \t\]+TESTS\[ \t\]+"
set mdl     "\nmodule\[ \t\]+load\[ \t\]+"


testouterr_cmd_re "csh" "display $iplain0" [if_implicitdefault OK ERR] [if_implicitdefault "$modlin\n$p$oplain0$mw$oplain0$cf$cplain/dir2$sv$oplain0$nl" "$err_nodefault'$iplain0'"]
testouterr_cmd_re "csh" "display $iplain1" [if_implicitdefault OK ERR] [if_implicitdefault "$modlin\n$p$oplain1$mw$oplain1$cf$cplain/dir1$sv$oplain1$nl" "$err_nodefault'$iplain1'"]

testouterr_cmd_re "csh" "display $imodulerc0" "OK" "$modlin\n$p$omodulerc0$mw$omodulerc0$cf$cmodulerc$sv$omodulerc0$nl"
testouterr_cmd_re "csh" "display $imodulerc1" "OK" "$modlin\n$p$omodulerc1$mw$omodulerc1$cf$cmodulerc$sv$omodulerc1$nl"
testouterr_cmd_re "csh" "display $imodulerc2" "OK" "$modlin\n$p$omodulerc2$mw$omodulerc2$cf$cmodulerc$sv$omodulerc2$nl"
testouterr_cmd_re "csh" "display modulerc/foo" OK "$modlin\n$p$omodulerc1$mw$omodulerc1$cf$cmodulerc$sv$omodulerc1$nl"

testouterr_cmd_re "csh" "display $iversion0" "OK" "$modlin\n$p$oversion0$mw$oversion0$cf$cversion$sv$oversion0$nl"
testouterr_cmd_re "csh" "display $iversion1" "OK" "$modlin\n$p$oversion1$mw$oversion1$cf$cversion$sv$oversion1$nl"
testouterr_cmd_re "csh" "display $iversion2" "OK" "$modlin\n$p$oversion2$mw$oversion2$cf$cversion$sv$oversion2$nl"

testouterr_cmd_re "csh" "display $iload0" [if_implicitdefault OK ERR] [if_implicitdefault "$modlin\n$p$oload0$mw$oload0$cf$cload$mdl$rload0$sv$oload0$svs$osload0$nl" "$err_nodefault'$iload0'"]
testouterr_cmd_re "csh" "display $iload1" [if_implicitdefault OK ERR] [if_implicitdefault "$modlin\n$p$oload1$mw$oload1$cf$cload$mdl$rload1$sv$oload1$svs$osload1$nl" "$err_nodefault'$iload1'"]
testouterr_cmd_re "csh" "display $iload2" "OK" "$modlin\n$p$oload2$mw$oload2$cf$cload$mdl$rload2$sv$oload2$svs$osload2$nl"

testouterr_cmd_re "csh" "display $ialias0" [if_implicitdefault OK ERR] [if_implicitdefault "$modlin\n$p$oalias0$mw$oalias0$cf$calias$sv$oalias0$nl" "$err_nodefault'$ialias0'"]
testouterr_cmd_re "csh" "display $ialias1" "OK" "$modlin\n$p$oalias1$mw$oalias1$cf$calias$sv$oalias1$nl"
testouterr_cmd_re "csh" "display $ialias2" "OK" "$modlin\n$p$oalias2$mw$oalias2$cf$calias$sv$oalias2$nl"
testouterr_cmd_re "csh" "display $ialias3" "OK" "$modlin\n$p$oalias3$mw$oalias3$cf$calias$sv$oalias3$nl"

testouterr_cmd_re "csh" "display $isym0" [if_implicitdefault OK ERR] [if_implicitdefault "$modlin\n$p$osym0$mw$osym0$cf$csym$sv$osym0$nl" "$err_nodefault'$isym0'"]
testouterr_cmd_re "csh" "display $isym1" "OK" "$modlin\n$p$osym1$mw$osym1$cf$csym$sv$osym1$nl"
testouterr_cmd_re "csh" "display $isym2" "OK" "$modlin\n$p$osym2$mw$osym2$cf$csym$sv$osym2$nl"

testouterr_cmd_re "csh" "display $ivirt0" [if_implicitdefault OK ERR] [if_implicitdefault "$modlin\n$pvirtre$mw$ovirt0$sv$ovirt0$nl" "$err_nodefault'$ivirt0'"]
testouterr_cmd_re "csh" "display $ivirt1" "OK" "$modlin\n$pvirtre$mw$ovirt1$sv$ovirt1$nl"
testouterr_cmd_re "csh" "display $ivirt2" "OK" "$modlin\n$pvirtre$mw$ovirt2$sv$ovirt2$nl"
testouterr_cmd_re "csh" "display $ivirt3" "OK" "$modlin\n$pvirtre$mw$ovirt3$sv$ovirt3$nl"
testouterr_cmd_re "csh" "display $ivirt4" [if_implicitdefault OK ERR] [if_implicitdefault "$modlin\n$pvirtre$mw$ovirt4$sv$ovirt4$nl" "$err_nodefault'$ivirt4'"]
testouterr_cmd_re "csh" "display $ivirt5" [if_implicitdefault OK ERR] [if_implicitdefault "$modlin\n$pvirtre$mw$ovirt5$sv$ovirt5$nl" "$err_nodefault'$ivirt5'"]
testouterr_cmd_re "csh" "display $ivirt6" "OK" "$modlin\n$pvirtre$mw$ovirt6$sv$ovirt6$nl"
testouterr_cmd_re "csh" "display $ivirt7" [if_implicitdefault OK ERR] [if_implicitdefault "$modlin\n$pvirtre$mw$ovirt7$sv$ovirt7$nl" "$err_nodefault'$ivirt7'"]
testouterr_cmd_re "csh" "display $ivirt8" [if_implicitdefault OK ERR] [if_implicitdefault "$modlin\n$pvirtre$mw$ovirt8$sv$ovirt8$nl" "$err_nodefault'$ivirt8'"]

testouterr_cmd_re "csh" "display $idalias0" [if_implicitdefault OK ERR] [if_implicitdefault "$modlin\n$p$odalias0$mw$odalias0$nl" "$err_nodefault'$idalias1'"]
testouterr_cmd_re "csh" "display $idalias1" [if_implicitdefault OK ERR] [if_implicitdefault "$modlin\n$p$odalias1$mw$odalias1$nl" "$err_nodefault'$idalias1'"]

set err_badvers "$error_msgs: Invalid ModulesVersion 'dir1/2.0' defined"
testouterr_cmd_re "csh" "display $ibadvers0" ERR [if_implicitdefault "$err_badvers\n$modlin\n$p$obadvers0$mw$obadvers0$nl" "$err_badvers\n$err_nodefault'$ibadvers0'"]
testouterr_cmd_re "csh" "display $ibadvers1" ERR [if_implicitdefault "$err_badvers\n$modlin\n$p$obadvers1$mw$obadvers1$nl" "$err_badvers\n$err_nodefault'$ibadvers1'"]

reset_test_env
