diff --git a/testsuite/modules.00-init/140-color.exp b/testsuite/modules.00-init/140-color.exp index 0679cf50e..b2e4bf3ce 100644 --- a/testsuite/modules.00-init/140-color.exp +++ b/testsuite/modules.00-init/140-color.exp @@ -541,6 +541,33 @@ unsetenv_var MODULES_ADVANCED_VERSION_SPEC setenv_path_var MODULEPATH $modpath +# +# alias/indesym rendering tests on list +# + +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} +setenv_loaded_module [list foo/1.0] [list $modpath.3/foo/1.0] +setenv_var __MODULES_LMALTNAME foo/1.0&foo/bar&foo&al|alfoo + +#FIXME +set tserr " 1\\) [sgr 96]alfoo[sgr 0] 2\\) foo/1.0[sgr 2]\\([sgr 22][sgr 95]bar[sgr 0][sgr 2]\\)[sgr 22] + +Key: +[sgr 2]\\([sgr 22][sgr 95]symbolic-version[sgr 0][sgr 2]\\)[sgr 22] [sgr 96]module-alias[sgr 0] " +testouterr_cmd_re sh {list --color=always -o alias:idx:sym:key} OK $tserr +set tserr " 1\\) [sgr 95]foo/bar[sgr 0] + 2\\) [sgr 96]alfoo[sgr 0] + 3\\) foo/1.0 + +Key: +[sgr 95]symbolic-version[sgr 0] [sgr 96]module-alias[sgr 0] " +testouterr_cmd_re sh {list --color=always -t -o alias:idx:indesym:sym:key} OK $tserr + +unsetenv_var __MODULES_LMALTNAME +unsetenv_loaded_module +unsetenv_var MODULES_COLORS + + # # Clean up variables used in this test case # diff --git a/testsuite/modules.70-maint/361-list_output.exp b/testsuite/modules.70-maint/361-list_output.exp index cd64e6f6b..95e468d9e 100644 --- a/testsuite/modules.70-maint/361-list_output.exp +++ b/testsuite/modules.70-maint/361-list_output.exp @@ -242,6 +242,29 @@ unsetenv_var MODULES_LIST_TERSE_OUTPUT unsetenv_var __MODULES_LMTAG +# +# alias test +# + +setenv_var __MODULES_LMALTNAME foo/1.0&foo/bar&foo&al|alfoo +testouterr_cmd sh {list --output=alias:idx} OK " 1) alfoo 2) foo/1.0 " +testouterr_cmd sh {list --output=alias:idx:sym:key} OK " 1) alfoo(@) 2) foo/1.0(bar) \n\nKey:\n(@)=module-alias (symbolic-version) " +setenv_var MODULES_LIST_TERSE_OUTPUT idx:alias +testouterr_cmd sh {list -t} OK " 1) alfoo \n 2) foo/1.0 " +unsetenv_var MODULES_LIST_TERSE_OUTPUT + + +# +# indesym test +# + +testouterr_cmd sh {list --output=indesym:idx} OK " 1) foo/bar 2) foo/1.0 " +testouterr_cmd sh {list --output=alias:idx:indesym:sym:key} OK " 1) foo/bar 2) alfoo 3) foo/1.0 " +setenv_var MODULES_LIST_TERSE_OUTPUT idx:alias:sym:indesym +testouterr_cmd sh {list -t} OK " 1) foo/bar \n 2) alfoo \n 3) foo/1.0 " +unsetenv_var MODULES_LIST_TERSE_OUTPUT + + # # -o/--output append/subtract tests # diff --git a/testsuite/modules.70-maint/400-list-search.exp b/testsuite/modules.70-maint/400-list-search.exp index a55944843..be6ab42ac 100644 --- a/testsuite/modules.70-maint/400-list-search.exp +++ b/testsuite/modules.70-maint/400-list-search.exp @@ -208,6 +208,30 @@ unsetenv_loaded_module unsetenv_var MODULES_ADVANCED_VERSION_SPEC +# alias & indesym +setenv_loaded_module [list foo/1.0] [list $mp/foo/1.0] +setenv_var __MODULES_LMALTNAME foo/1.0&foo/bar&foo&al|foo/qux +testouterr_cmd sh {list -t -o alias:indesym foo} OK "foo/bar\nfoo/qux\nfoo/1.0" +testouterr_cmd sh {list -t -o alias:indesym foo/1} OK foo/1.0 +testouterr_cmd sh {list -t -o alias:indesym foo/b} OK foo/bar +testouterr_cmd sh {list -t -o alias:indesym foo/q} OK foo/qux + +testouterr_cmd sh {list -t -o tag foo/b} OK foo/1.0 +testouterr_cmd sh {list -t -o tag foo/q} OK foo/1.0 + +# hidden-loaded tag does not apply to symbol or alias +setenv_var __MODULES_LMTAG foo/1.0&hidden-loaded +testouterr_cmd sh {list -t -o alias:indesym foo/1} OK {} +testouterr_cmd sh {list -t -o alias:indesym foo/b} OK foo/bar +testouterr_cmd sh {list -t -o alias:indesym foo/q} OK foo/qux +testouterr_cmd sh {list -t -o alias:indesym foo} OK "foo/bar\nfoo/qux" + + +unsetenv_path_var __MODULES_LMTAG +unsetenv_path_var __MODULES_LMALTNAME +unsetenv_loaded_module + + # # Cleanup #