@@ -3956,6 +3956,30 @@ def test_set_default_module(self):
39563956 else :
39573957 self .assertTrue (False , "Uknown module syntax: %s" % get_module_syntax ())
39583958
3959+ # make sure default is also set for moduleclass symlink
3960+ toy_mod_symlink_dir = os .path .join (self .test_installpath , 'modules' , 'tools' , 'toy' )
3961+ if get_module_syntax () == 'Lua' :
3962+ self .assertEqual (sorted (os .listdir (toy_mod_symlink_dir )), ['0.0-deps.lua' , 'default' ])
3963+ default_symlink = os .path .join (toy_mod_symlink_dir , 'default' )
3964+ mod_symlink = os .path .join (toy_mod_symlink_dir , '0.0-deps.lua' )
3965+ self .assertTrue (os .path .islink (default_symlink ))
3966+ self .assertTrue (os .path .islink (mod_symlink ))
3967+ self .assertEqual (os .readlink (default_symlink ), '0.0-deps.lua' )
3968+ modfile_path = os .path .join (toy_mod_dir , '0.0-deps.lua' )
3969+ self .assertTrue (os .path .samefile (os .readlink (mod_symlink ), modfile_path ))
3970+ elif get_module_syntax () == 'Tcl' :
3971+ self .assertEqual (sorted (os .listdir (toy_mod_symlink_dir )), ['.version' , '0.0-deps' ])
3972+ version_symlink = os .path .join (toy_mod_symlink_dir , '.version' )
3973+ mod_symlink = os .path .join (toy_mod_symlink_dir , '0.0-deps' )
3974+ self .assertTrue (os .path .islink (version_symlink ))
3975+ self .assertTrue (os .path .islink (mod_symlink ))
3976+ versionfile_path = os .path .join (toy_mod_dir , '.version' )
3977+ self .assertEqual (os .readlink (version_symlink ), versionfile_path )
3978+ modfile_path = os .path .join (toy_mod_dir , '0.0-deps' )
3979+ self .assertTrue (os .path .samefile (os .readlink (mod_symlink ), modfile_path ))
3980+ else :
3981+ self .assertTrue (False , "Uknown module syntax: %s" % get_module_syntax ())
3982+
39593983 def test_inject_checksums (self ):
39603984 """Test for --inject-checksums"""
39613985 topdir = os .path .dirname (os .path .abspath (__file__ ))
0 commit comments