Skip to content

Commit e62dbc0

Browse files
committed
ts: test setting env var with newline contained in value
Signed-off-by: Xavier Delaruelle <[email protected]>
1 parent 817e01a commit e62dbc0

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

testsuite/install.00-init/020-module.exp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,21 @@ foreach shell $shell_list {
177177
unsetenv_var TESTSUITE_UNSET
178178

179179

180+
# test special characters in environment variable
181+
foreach shell $shell_list {
182+
if {$shell in {csh tcsh}} {
183+
if {$install_wa277 eq {y}} {
184+
set tsout "abc : \\|<>!#$^&'\"()@x%y\\z:sh* -"
185+
} else {
186+
set tsout "abc : {}|<>!#$^&'\"()@x%y\\z:sh* -"
187+
}
188+
} else {
189+
set tsout "abc : {}|<>!#$^&'\"()@x%y\\z:sh*\n -"
190+
}
191+
testouterr_cmd $shell "module use \"$testsuite_modpath\"\; module load eschars/1.0\; echo \"\$pathelogical -\"" $tsout {}
192+
}
193+
194+
180195
#
181196
# Clean up variables used in this test case
182197
#

testsuite/modulefiles/eschars/1.0

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@
2727
#
2828
##############################################################################
2929

30-
setenv pathelogical "abc : {}|<>!#$^&'\"()@x%y\\z:sh*"
30+
setenv pathelogical "abc : {}|<>!#$^&'\"()@x%y\\z:sh*\n"
3131

testsuite/modules.50-cmds/022-setenv-eschars.exp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,19 @@ lappend ans_csh [list set pathelogical "abc\\ :\\ \\{\\}\\|\\<\\>\\!\\#\\$\\^\\&
4343
lappend ans_csh [list set _LMFILES_ $modulefile]
4444
lappend ans_csh [list set LOADEDMODULES $module]
4545

46-
lappend ans_sh [list set pathelogical "abc : {}|<>!#$^&'\\''\"()@x%y\\z:sh*" noescval]
46+
lappend ans_sh [list set pathelogical "abc : {}|<>!#$^&'\\''\"()@x%y\\z:sh*\n" noescval]
4747
lappend ans_sh [list set _LMFILES_ $modulefile]
4848
lappend ans_sh [list set LOADEDMODULES $module]
4949

50-
lappend ans_fish [list set pathelogical "abc : {}|<>!#$^&\\'\"()@x%y\\z:sh*" noescval]
50+
lappend ans_fish [list set pathelogical "abc : {}|<>!#$^&\\'\"()@x%y\\z:sh*\n" noescval]
5151
lappend ans_fish [list set _LMFILES_ $modulefile]
5252
lappend ans_fish [list set LOADEDMODULES $module]
5353

54-
lappend ans2 [list set pathelogical "abc : {}|<>!#$^&'\"()@x%y\\z:sh*"]
54+
lappend ans2 [list set pathelogical "abc : {}|<>!#$^&'\"()@x%y\\z:sh*\n"]
5555
lappend ans2 [list set _LMFILES_ $modulefile]
5656
lappend ans2 [list set LOADEDMODULES $module]
5757

58-
lappend ans_pwsh [list set pathelogical "abc : {}|<>!#$^&\\'\"()@x%y\\z:sh*"]
58+
lappend ans_pwsh [list set pathelogical "abc : {}|<>!#$^&\\'\"()@x%y\\z:sh*\n"]
5959
lappend ans_pwsh [list set _LMFILES_ $modulefile]
6060
lappend ans_pwsh [list set LOADEDMODULES $module]
6161

0 commit comments

Comments
 (0)