##############################################################################
#   Modules Revision 3.0
#   Providing a flexible user environment
#
#   File:		modules.50-cmds/%M%
#   Revision:		%I%
#   First Edition:	1995/12/06
#   Last Mod.:		%U%, %G%
#
#   Authors:		Jens Hamisch, Jens.Hamisch@Strawberry.COM
#
#   Description:	Testuite testsequence
#   Command:		load
#   Modulefiles:	verbose/on, verbose/off, verbose/undef
#   Sub-Command:
#
#   Comment:	%C{
#			Tests the module verbosity command. This testcase
#			concerns switching verbosity on and off. It also
#			checks bad arguments to the 'module-verbosity'
#			command.
#		}C%
#
##############################################################################

# ensure auto symbolic versions are not set for these tests
setenv_var MODULES_ADVANCED_VERSION_SPEC 0

#
#  Variables. This test forces a module load command. It will result in the
#    environment variables "_LMFILES_", "LOADEDMODULES" and "testsuite" to
#    be set up
#

set module_1 "verbose/on"
set modulefile_1 "$modpath/$module_1"

set module_2 "verbose/off"
set modulefile_2 "$modpath/$module_2"

set module_3 "verbose/undef"
set modulefile_3 "$modpath/$module_3"

set err_verb "$warn_msgs: 'module-verbosity' command not implemented"

#
#  The tests
#

# different behavior than C-version: on Tcl-version 'module-verbosity' command is
# not handled and will always return a warning message to inform the user.
lappend ans [list set _LMFILES__modshare "$modulefile_1:1"]
lappend ans [list set LOADEDMODULES_modshare "$module_1:1"]
lappend ans [list set _LMFILES_ $modulefile_1]
lappend ans [list set LOADEDMODULES $module_1]
testouterr_cmd "csh" "load $module_1" $ans [msg_load $module_1 $err_verb]

set ans [list]
lappend ans [list set _LMFILES__modshare "$modulefile_2:1"]
lappend ans [list set LOADEDMODULES_modshare "$module_2:1"]
lappend ans [list set _LMFILES_ $modulefile_2]
lappend ans [list set LOADEDMODULES $module_2]
testouterr_cmd "csh" "load $module_2" $ans [msg_load $module_2 $err_verb]

set ans [list]
lappend ans [list set _LMFILES__modshare "$modulefile_3:1"]
lappend ans [list set LOADEDMODULES_modshare "$module_3:1"]
lappend ans [list set _LMFILES_ $modulefile_3]
lappend ans [list set LOADEDMODULES $module_3]
testouterr_cmd "csh" "load $module_3" $ans [msg_load $module_3 $err_verb]

#
#  Cleanup
#

reset_test_env
