Skip to content

Commit

Permalink
testsuite: add 3-arg bad case test for putsModfileCmd
Browse files Browse the repository at this point in the history
  • Loading branch information
xdelaruelle committed Dec 9, 2017
1 parent d7a9e7a commit 943d3cc
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 66 deletions.
30 changes: 30 additions & 0 deletions testsuite/modulefiles/puts/7
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#%Module1.0

##############################################################################
# Modules Revision 3.0
# Providing a flexible user environment
#
# File: puts/%M%
# Revision: %I%
# First Edition: 2017/12/09
# Last Mod.: %U%, %G%
#
# Authors: Xavier Delaruelle, xavier.delaruelle@cea.fr
#
# Description: Testuite modulefile
# Command:
# Sub-Command: puts
#
# Invocation: load @M@
# Result: %R{
# }R%
# Comment: %C{
# Check the 'puts' command
# }C%
#
##############################################################################

if {[module-info mode "load"] || [module-info mode "display"]} {
puts -badarg stdbad texterr2
}
setenv testsuite ok
13 changes: 13 additions & 0 deletions testsuite/modules.50-cmds/310-puts.exp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,19 @@ testouterr_cmd_re "sh" "load $module" "ERR" "$bad_puts"
testouterr_cmd_re "sh" "display $module" "ERR" "$modlin\n$modulefilere:\n\n$bad_puts\n$modlin"


set module "puts/7"
set modulefilere "$modpathre/$module"
set bad_puts "$moderr_msgs: wrong # args: should be \"puts \\\?-nonewline\\\? \\\?channelId\\\? string\"
In '$modulefilere'
$err_contact"

# test loading
testouterr_cmd_re "sh" "load $module" "ERR" "$bad_puts"

# test displaying
testouterr_cmd_re "sh" "display $module" "ERR" "$modlin\n$modulefilere:\n\n$bad_puts\n$modlin"


#
# Cleanup
#
Expand Down

0 comments on commit 943d3cc

Please sign in to comment.