Debian Codegraph @

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

raw
1 ##############################################################################
2 # Modules Revision 3.0
3 # Providing a flexible user environment
4 #
5 # File: modules.50-cmds/%M%
6 # Revision: %I%
7 # First Edition: 2002/05/02
8 # Last Mod.: %U%, %G%
9 #
10 # Authors: R.K. Owen, Ph.D., [email protected]
11 #
12 # Description: Testuite testsequence
13 # Command: load
14 # Modulefiles: eschars/1.0
15 # Sub-Command:
16 #
17 # Comment: %C{
18 # Tests the 'setenv' module subcommand for escaping
19 # pathelogical chars.
20 # }C%
21 #
22 ##############################################################################
23
24 skip_if_quick_mode
25
26 # ensure auto symbolic versions are not set for these tests
27 setenv_var MODULES_ADVANCED_VERSION_SPEC 0
28
29 #
30 # Variables. This test forces a module load command. It will result in the
31 # environment variables "_LMFILES_", "LOADEDMODULES" and "pathelogical" to
32 # be set up
33 #
34
35 set module "eschars/1.0"
36 set modulefile "$modpath/$module"
37
38 #
39 # For the different shells ...
40 #
41
42 lappend ans_csh [list set pathelogical "abc\\ :\\ \\{\\}\\|\\<\\>\\!\\#\\$\\^\\&\\'\\\"\\(\\)@x%y\\\\z:sh\\*" noescval]
43 lappend ans_csh [list set _LMFILES_ $modulefile]
44 lappend ans_csh [list set LOADEDMODULES $module]
45
46 lappend ans_sh [list set pathelogical "abc : {}|<>!#$^&'\\''\"()@x%y\\z:sh*\n" noescval]
47 lappend ans_sh [list set _LMFILES_ $modulefile]
48 lappend ans_sh [list set LOADEDMODULES $module]
49
50 lappend ans_fish [list set pathelogical "abc : {}|<>!#$^&\\'\"()@x%y\\z:sh*\n" noescval]
51 lappend ans_fish [list set _LMFILES_ $modulefile]
52 lappend ans_fish [list set LOADEDMODULES $module]
53
54 lappend ans2 [list set pathelogical "abc : {}|<>!#$^&'\"()@x%y\\z:sh*\n"]
55 lappend ans2 [list set _LMFILES_ $modulefile]
56 lappend ans2 [list set LOADEDMODULES $module]
57
58 lappend ans_pwsh [list set pathelogical "abc : {}|<>!#$^&\\'\"()@x%y\\z:sh*\n"]
59 lappend ans_pwsh [list set _LMFILES_ $modulefile]
60 lappend ans_pwsh [list set LOADEDMODULES $module]
61
62 #
63 # The tests
64 #
65
66 foreach sh $supported_shells {
67 switch -- $sh {
68 sh - bash - ksh - zsh {
69 test_cmd $sh "load $module" $ans_sh
70 }
71 fish {
72 test_cmd $sh "load $module" $ans_fish
73 }
74 csh - tcsh {
75 test_cmd $sh "load $module" $ans_csh
76 }
77 pwsh {
78 test_cmd $sh "load $module" $ans_pwsh
79 }
80 default {
81 test_cmd $sh "load $module" $ans2
82 }
83 }
84 }
85
86 #
87 # Cleanup
88 #
89
90 reset_test_env