Files
modules/testsuite/modules.00-init/070-command.exp
Xavier Delaruelle cfe0657bc9 Fix mod subcmd abbrev match
Fix module sub-command abbreviation match to ensure passed abbreviated
form fully match sub-command, not only its minimal abbreviated form. As
an example, ``lod`` or ``loda`` do not match anymore the ``load``
sub-command, ``lo`` or ``loa`` still do.
2020-01-09 20:39:21 +01:00

54 lines
1.3 KiB
Plaintext

##############################################################################
# Modules Revision 3.0
# Providing a flexible user environment
#
# File: modules.00-init/%M%
# Revision: %I%
# First Edition: 2016/08/20
# Last Mod.: %U%, %G%
#
# Authors: Xavier Delaruelle, xavier.delaruelle@cea.fr
#
# Description: Testuite testsequence
# Command:
# Sub-Command:
#
# Comment: %C{
# Check command line commands with a bad command name.
# }C%
#
##############################################################################
#
# The following answers are to be expected in this testcase ...
#
set bad_arg "$error_msgs: Invalid command "
#
# The tests
#
if { $verbose > 0 } {
send_user "\tChecking command line commands ...\n"
}
# invalid command leads to error code
testouterr_cmd ALL foobar ERR "$bad_arg'foobar'\n$err_typehelp"
# bad sub-command abbreviation
testouterr_cmd sh lob ERR "$bad_arg'lob'\n$err_typehelp"
testouterr_cmd sh unlob ERR "$bad_arg'unlob'\n$err_typehelp"
testouterr_cmd sh loada ERR "$bad_arg'loada'\n$err_typehelp"
testouterr_cmd sh lista ERR "$bad_arg'lista'\n$err_typehelp"
testouterr_cmd sh aval ERR "$bad_arg'aval'\n$err_typehelp"
testouterr_cmd sh a ERR "$bad_arg'a'\n$err_typehelp"
#
# Clean up variables used in this test case
#
unset bad_arg