Debian Codegraph @

testsuite/modulefiles/getenv/1.0

raw
1 #%Module1.0
2
3 ##############################################################################
4 # Modules Revision 3.0
5 # Providing a flexible user environment
6 #
7 # File: getenv/%M%
8 # Revision: %I%
9 # First Edition: 2017/04/28
10 # Last Mod.: %U%, %G%
11 #
12 # Authors: Xavier Delaruelle, [email protected]
13 #
14 # Description: Testuite modulefile
15 # Command:
16 # Sub-Command: getenv
17 #
18 # Invocation: load @M@, display @M@
19 # Result: %R{
20 # }R%
21 # Comment: %C{
22 # Check the 'getenv' command
23 # }C%
24 #
25 ##############################################################################
26
27 setenv testsuite "[getenv TEST]"
28 setenv testsuite2 [getenv TEST2 {}]
29
30 if {[info exists env(TESTSUITE_GETENV)]} {
31 switch -- $env(TESTSUITE_GETENV) {
32 toomany1 {
33 setenv testsuite3 [getenv TEST {} other]
34 }
35 toomany2 {
36 setenv testsuite3 [getenv --return-value TEST {} other]
37 }
38 toofew1 {
39 setenv testsuite3 [getenv]
40 }
41 toofew2 {
42 setenv testsuite3 [getenv --return-value]
43 }
44 misplaced1 {
45 setenv testsuite3 [getenv TEST --return-value]
46 }
47 misplaced2 {
48 setenv testsuite3 [getenv TEST foo --return-value]
49 }
50 return1 {
51 setenv testsuite3 [getenv --return-value TEST]
52 }
53 return2 {
54 setenv testsuite3 [getenv --return-value TEST foo]
55 }
56 }
57 }