Skip to content

Commit 580b375

Browse files
committed
test for path_entry_reorder added
Signed-off-by: Achim Gsell <achim.gsell@psi.ch>
1 parent 38df309 commit 580b375

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

testsuite/modulefiles/append/9.0

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#%Module1.0
2+
3+
##############################################################################
4+
# Modules Revision 3.0
5+
# Providing a flexible user environment
6+
#
7+
# File: append/%M%
8+
# Revision: %I%
9+
# First Edition: 2026/01/08
10+
# Last Mod.: %U%, %G%
11+
#
12+
# Authors: Achim Gsell, achim.gsell@psi.ch
13+
#
14+
# Description: Test appending paths with path_entry_enabled
15+
# Command:
16+
# Sub-Command: append-path
17+
#
18+
# Invocation: load @M@/@V@
19+
# Comment: %C{
20+
# }C%
21+
#
22+
##############################################################################
23+
24+
append-path FOO /test/dir1 /test/dir2 /test/dir3

testsuite/modules.50-cmds/040-append.exp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,26 @@ lappend ans [list unset LOADEDMODULES]
485485
testouterr_cmd "sh" "unload $module" $ans {}
486486

487487

488+
#
489+
# test that path entry is not removed if added twice and path_entry_reorder
490+
# is true
491+
#
492+
set module "append/9.0"
493+
set modulefile "$modpath/$module"
494+
495+
setenv_var MODULES_PATH_ENTRY_REORDER 1
496+
setenv_var FOO /test/dir2
497+
unsetenv_var __MODULES_SHARE_FOO
498+
499+
unsetenv_loaded_module
500+
set ans [list]
501+
lappend ans [list set __MODULES_SHARE_FOO "/test/dir2:2"]
502+
lappend ans [list set FOO "/test/dir1:/test/dir2:/test/dir3"]
503+
lappend ans [list set _LMFILES_ $modulefile]
504+
lappend ans [list set LOADEDMODULES $module]
505+
506+
testouterr_cmd "sh" "load $module" $ans ""
507+
488508
#
489509
# --glob option
490510
#

0 commit comments

Comments
 (0)