Skip to content

Commit 733f1bf

Browse files
committed
ts: test indesym avail_output/avail_terse_output element
1 parent fed58aa commit 733f1bf

File tree

3 files changed

+76
-8
lines changed

3 files changed

+76
-8
lines changed

testsuite/modules.00-init/140-color.exp

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,42 @@ unsetenv_var TESTSUITE_ENABLE_SITECONFIG_TWICEINITCOLORS
505505
}
506506

507507

508+
#
509+
# indesym rendering tests
510+
#
511+
512+
setenv_path_var MODULEPATH $modpath.2
513+
setenv_var MODULES_ADVANCED_VERSION_SPEC 0
514+
setenv_var MODULES_COLORS {hi=1:db=2:tr=2:se=2:er=91:wa=93:me=95:in=94:mp=1;94:di=94:al=96:de=4:sy=95}
515+
set tserr "[sgr 95][sgr 1]hide3/sym[sgr 22][sgr 0]
516+
517+
Key:
518+
[sgr 95]symbolic-version[sgr 0] "
519+
testouterr_cmd_re sh {avail --color=always -o key:indesym hide3/sym} OK $tserr
520+
set tserr "[sgr 1]hide3/sub2[sgr 22]/4.0
521+
[sgr 1]hide3/sub2[sgr 22]/5.0
522+
[sgr 95][sgr 1]hide3/sub2[sgr 22]/default[sgr 0]
523+
[sgr 95][sgr 1]hide3/sub2[sgr 22]/new[sgr 0]
524+
[sgr 95][sgr 1]hide3/sub2[sgr 22]/sym[sgr 0]
525+
526+
Key:
527+
[sgr 95]symbolic-version[sgr 0] "
528+
testouterr_cmd_re sh {avail -w 20 --color=always -o key:indesym hide3/sub2} OK $tserr
529+
testouterr_cmd_re sh {avail -w 20 --color=always -o key:indesym:dirwsym hide3/sub2} OK $tserr
530+
set tserr "[sgr 95][sgr 1]hide3/sub2/default[sgr 22][sgr 0]
531+
532+
Key:
533+
[sgr 95]symbolic-version[sgr 0] "
534+
testouterr_cmd_re sh {avail --color=always -o key:indesym hide3/sub2/default} OK $tserr
535+
# no color definition for symbolic versions
536+
setenv_var MODULES_COLORS {hi=1:db=2:tr=2:se=2:er=91:wa=93:me=95:in=94:mp=1;94:di=94:al=96:de=4}
537+
set tserr "[sgr 1]hide3/sym[sgr 22] "
538+
testouterr_cmd_re sh {avail --color=always -o key:indesym hide3/sym} OK $tserr
539+
unsetenv_var MODULES_COLORS
540+
unsetenv_var MODULES_ADVANCED_VERSION_SPEC
541+
setenv_path_var MODULEPATH $modpath
542+
543+
508544
#
509545
# Clean up variables used in this test case
510546
#

testsuite/modules.70-maint/220-config.exp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ array set configvalid [list\
159159
advanced_version_spec {0 1}\
160160
auto_handling {0 1}\
161161
avail_indepth {0 1}\
162-
avail_output {modulepath alias dirwsym sym tag key variant variantifspec}\
163-
avail_terse_output {modulepath alias dirwsym sym tag key variant variantifspec}\
162+
avail_output {modulepath alias dirwsym indesym sym tag key variant variantifspec}\
163+
avail_terse_output {modulepath alias dirwsym indesym sym tag key variant variantifspec}\
164164
cache_buffer_bytes {4096 1000000}\
165165
cache_expiry_secs {0 31536000}\
166166
collection_pin_version {0 1}\

testsuite/modules.70-maint/360-avail_output.exp

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ testouterr_cmd sh {ml -o sym -j foo/1.0} ERR "$error_msgs: Unsupported option '-
8989

9090
# invalid value set
9191
set tserr_invalid_output_val "$error_msgs: Invalid element in value list for '--output' option on avail sub-command
92-
Allowed elements are: modulepath alias dirwsym sym tag key variant variantifspec (separated by ':')"
92+
Allowed elements are: modulepath alias dirwsym indesym sym tag key variant variantifspec (separated by ':')"
9393
set tserr_invalid_o_val "$error_msgs: Invalid element in value list for '-o' option on avail sub-command
94-
Allowed elements are: modulepath alias dirwsym sym tag key variant variantifspec (separated by ':')"
94+
Allowed elements are: modulepath alias dirwsym indesym sym tag key variant variantifspec (separated by ':')"
9595
testouterr_cmd sh {avail --output=foo foo} ERR $tserr_invalid_output_val
9696
testouterr_cmd sh {avail --output=sym,alias foo} ERR $tserr_invalid_output_val
9797
testouterr_cmd sh {avail --output="sym alias" foo} ERR $tserr_invalid_output_val
@@ -136,9 +136,9 @@ if {[cmpversion $tclsh_version 8.6] == -1} {
136136
testouterr_cmd_re sh {load output/1.0} ERR [escre [msg_load output/1.0 [msg_moderr {Missing value for '--output' option} {module unload --not-req --output bar<EXM>} $mp/output/1.0 3]]]
137137

138138
setenv_var TESTSUITE_OUTPUT_INMODFILE 20
139-
testouterr_cmd_re sh {load output/1.0} ERR [escre [msg_load output/1.0 [msg_moderr "Invalid element in value list for '--output' option on avail sub-command\nAllowed elements are: modulepath alias dirwsym sym tag key variant variantifspec (separated by ':')" {module avail --output=header foo/1.0<EXM>} $mp/output/1.0 3]]]
139+
testouterr_cmd_re sh {load output/1.0} ERR [escre [msg_load output/1.0 [msg_moderr "Invalid element in value list for '--output' option on avail sub-command\nAllowed elements are: modulepath alias dirwsym indesym sym tag key variant variantifspec (separated by ':')" {module avail --output=header foo/1.0<EXM>} $mp/output/1.0 3]]]
140140
setenv_var TESTSUITE_OUTPUT_INMODFILE 21
141-
testouterr_cmd_re sh {load output/1.0} ERR [escre [msg_load output/1.0 [msg_moderr "Invalid element in value list for '-o' option on avail sub-command\nAllowed elements are: modulepath alias dirwsym sym tag key variant variantifspec (separated by ':')" {module avail -o sym,alias foo/1.0<EXM>} $mp/output/1.0 3]]]
141+
testouterr_cmd_re sh {load output/1.0} ERR [escre [msg_load output/1.0 [msg_moderr "Invalid element in value list for '-o' option on avail sub-command\nAllowed elements are: modulepath alias dirwsym indesym sym tag key variant variantifspec (separated by ':')" {module avail -o sym,alias foo/1.0<EXM>} $mp/output/1.0 3]]]
142142

143143
} else {
144144

@@ -165,9 +165,9 @@ if {[cmpversion $tclsh_version 8.6] == -1} {
165165
testouterr_cmd sh {load output/1.0} ERR [msg_load output/1.0 [msg_moderr {Missing value for '--output' option} {module unload --not-req --output bar} $mp/output/1.0 15]]
166166

167167
setenv_var TESTSUITE_OUTPUT_INMODFILE 20
168-
testouterr_cmd sh {load output/1.0} ERR [msg_load output/1.0 [msg_moderr "Invalid element in value list for '--output' option on avail sub-command\nAllowed elements are: modulepath alias dirwsym sym tag key variant variantifspec (separated by ':')" {module avail --output=header foo/1.0} $mp/output/1.0 24]]
168+
testouterr_cmd sh {load output/1.0} ERR [msg_load output/1.0 [msg_moderr "Invalid element in value list for '--output' option on avail sub-command\nAllowed elements are: modulepath alias dirwsym indesym sym tag key variant variantifspec (separated by ':')" {module avail --output=header foo/1.0} $mp/output/1.0 24]]
169169
setenv_var TESTSUITE_OUTPUT_INMODFILE 21
170-
testouterr_cmd sh {load output/1.0} ERR [msg_load output/1.0 [msg_moderr "Invalid element in value list for '-o' option on avail sub-command\nAllowed elements are: modulepath alias dirwsym sym tag key variant variantifspec (separated by ':')" {module avail -o sym,alias foo/1.0} $mp/output/1.0 25]]
170+
testouterr_cmd sh {load output/1.0} ERR [msg_load output/1.0 [msg_moderr "Invalid element in value list for '-o' option on avail sub-command\nAllowed elements are: modulepath alias dirwsym indesym sym tag key variant variantifspec (separated by ':')" {module avail -o sym,alias foo/1.0} $mp/output/1.0 25]]
171171
}
172172

173173
unsetenv_var TESTSUITE_OUTPUT_INMODFILE
@@ -224,6 +224,38 @@ testouterr_cmd_re sh {avail foo/1.0} OK "$modlin $mpre $modlin\nfoo/1.0 "
224224
unsetenv_var MODULES_AVAIL_OUTPUT
225225

226226

227+
#
228+
# indesym test
229+
#
230+
231+
set tserr_avail_foo "foo/1.0\\(bar\\) "
232+
testouterr_cmd_re sh {avail -o modulepath:key:indesym foo/1.0} OK "$modlin $mpre $modlin\nfoo/1.0 "
233+
testouterr_cmd_re sh {avail -o modulepath:key:sym:indesym foo/1.0} OK "$modlin $mpre $modlin\nfoo/1.0 "
234+
testouterr_cmd_re sh {avail -w 120 -o modulepath:key:indesym foo} OK "$modlin $mpre $modlin\nfoo/0.2 foo/0.err foo/0.load foo/0.prereq foo/1.0 foo/2.0 foo/bar foo/sym "
235+
testouterr_cmd_re sh {avail -w 120 -o modulepath:key:indesym foo/bar} OK "$modlin $mpre $modlin\nfoo/bar "
236+
testouterr_cmd_re sh {avail -w 120 -o modulepath:key:indesym:sym foo/bar} OK "$modlin $mpre $modlin\nfoo/bar "
237+
setenv_var MODULES_AVAIL_TERSE_OUTPUT key:indesym
238+
testouterr_cmd sh {avail -t foo/bar} OK "foo/bar"
239+
testouterr_cmd sh {avail -t foo/1.0} OK "foo/1.0"
240+
unsetenv_var MODULES_AVAIL_TERSE_OUTPUT
241+
setenv_path_var MODULEPATH $modpath.2
242+
testouterr_cmd_re sh {avail -w 120 -o modulepath:key:dirwsym:indesym hide3/sub2} OK "$modlin $modpathre.2 $modlin\nhide3/sub2/4.0 hide3/sub2/5.0 hide3/sub2/default hide3/sub2/new hide3/sub2/sym "
243+
testouterr_cmd_re sh {avail -w 120 -o modulepath:key:indesym hide3/sub2} OK "$modlin $modpathre.2 $modlin\nhide3/sub2/4.0 hide3/sub2/5.0 hide3/sub2/default hide3/sub2/new hide3/sub2/sym "
244+
testouterr_cmd_re sh {avail -w 120 -o modulepath:key:dirwsym:indesym hide3/sym} OK "$modlin $modpathre.2 $modlin\nhide3/sym "
245+
testouterr_cmd_re sh {avail -w 120 -o modulepath:key:indesym hide3/sym} OK "$modlin $modpathre.2 $modlin\nhide3/sym "
246+
testouterr_cmd_re sh {avail -w 120 -o modulepath:key:indesym hide3/sub2/default} OK "$modlin $modpathre.2 $modlin\nhide3/sub2/default "
247+
testouterr_cmd_re sh {avail -w 120 -o modulepath:key:indesym hide3/sub2/4.0} OK "$modlin $modpathre.2 $modlin\nhide3/sub2/4.0 "
248+
testouterr_cmd_re sh {avail -w 120 -o modulepath:key:sym:indesym hide3/sub2/default} OK "$modlin $modpathre.2 $modlin\nhide3/sub2/default "
249+
testouterr_cmd_re sh {avail -w 120 -o modulepath:key:indesym:sym hide3/sub2/4.0} OK "$modlin $modpathre.2 $modlin\nhide3/sub2/4.0 "
250+
setenv_var MODULES_AVAIL_TERSE_OUTPUT key:indesym:dirwsym
251+
testouterr_cmd sh {avail -t hide3/sym} OK "hide3/sym"
252+
testouterr_cmd sh {avail -t -o key:indesym hide3/sym} OK "hide3/sym"
253+
testouterr_cmd sh {avail -t hide3/sub2/default} OK "hide3/sub2/default"
254+
testouterr_cmd sh {avail -t hide3/sub2/4.0} OK "hide3/sub2/4.0"
255+
unsetenv_var MODULES_AVAIL_TERSE_OUTPUT
256+
setenv_path_var MODULEPATH $mp
257+
258+
227259
#
228260
# tag test
229261
#

0 commit comments

Comments
 (0)