@@ -285,6 +285,7 @@ def test_toy_tweaked(self):
285285 ec_extra = '\n ' .join ([
286286 "versionsuffix = '-tweaked'" ,
287287 "modextrapaths = {'SOMEPATH': ['foo/bar', 'baz', '']}" ,
288+ "modextrapaths_append = {'SOMEPATH_APPEND': ['qux/fred', 'thud', '']}" ,
288289 "modextravars = {'FOO': 'bar'}" ,
289290 "modloadmsg = '%s'" % modloadmsg ,
290291 "modtclfooter = 'puts stderr \" oh hai!\" '" , # ignored when module syntax is Lua
@@ -319,13 +320,21 @@ def test_toy_tweaked(self):
319320 self .assertTrue (re .search (r'^prepend-path\s*SOMEPATH\s*\$root/foo/bar$' , toy_module_txt , re .M ))
320321 self .assertTrue (re .search (r'^prepend-path\s*SOMEPATH\s*\$root/baz$' , toy_module_txt , re .M ))
321322 self .assertTrue (re .search (r'^prepend-path\s*SOMEPATH\s*\$root$' , toy_module_txt , re .M ))
323+ self .assertTrue (re .search (r'^append-path\s*SOMEPATH_APPEND\s*\$root/qux/fred$' , toy_module_txt , re .M ))
324+ self .assertTrue (re .search (r'^append-path\s*SOMEPATH_APPEND\s*\$root/thud$' , toy_module_txt , re .M ))
325+ self .assertTrue (re .search (r'^append-path\s*SOMEPATH_APPEND\s*\$root$' , toy_module_txt , re .M ))
322326 mod_load_msg = r'module-info mode load.*\n\s*puts stderr\s*.*%s$' % modloadmsg_regex_tcl
323327 self .assertTrue (re .search (mod_load_msg , toy_module_txt , re .M ))
324328 self .assertTrue (re .search (r'^puts stderr "oh hai!"$' , toy_module_txt , re .M ))
325329 elif get_module_syntax () == 'Lua' :
326330 self .assertTrue (re .search (r'^setenv\("FOO", "bar"\)' , toy_module_txt , re .M ))
327331 pattern = r'^prepend_path\("SOMEPATH", pathJoin\(root, "foo/bar"\)\)$'
328332 self .assertTrue (re .search (pattern , toy_module_txt , re .M ))
333+ pattern = r'^append_path\("SOMEPATH_APPEND", pathJoin\(root, "qux/fred"\)\)$'
334+ self .assertTrue (re .search (pattern , toy_module_txt , re .M ))
335+ pattern = r'^append_path\("SOMEPATH_APPEND", pathJoin\(root, "thud"\)\)$'
336+ self .assertTrue (re .search (pattern , toy_module_txt , re .M ))
337+ self .assertTrue (re .search (r'^append_path\("SOMEPATH_APPEND", root\)$' , toy_module_txt , re .M ))
329338 self .assertTrue (re .search (r'^prepend_path\("SOMEPATH", pathJoin\(root, "baz"\)\)$' , toy_module_txt , re .M ))
330339 self .assertTrue (re .search (r'^prepend_path\("SOMEPATH", root\)$' , toy_module_txt , re .M ))
331340 mod_load_msg = r'^if mode\(\) == "load" then\n\s*io.stderr:write\(%s\)$' % modloadmsg_regex_lua
@@ -1514,6 +1523,9 @@ def test_toy_module_fulltxt(self):
15141523 r'prepend_path\("SOMEPATH", pathJoin\(root, "foo/bar"\)\)' ,
15151524 r'prepend_path\("SOMEPATH", pathJoin\(root, "baz"\)\)' ,
15161525 r'prepend_path\("SOMEPATH", root\)' ,
1526+ r'append_path\("SOMEPATH_APPEND", pathJoin\(root, "qux/fred"\)\)' ,
1527+ r'append_path\("SOMEPATH_APPEND", pathJoin\(root, "thud"\)\)' ,
1528+ r'append_path\("SOMEPATH_APPEND", root\)' ,
15171529 r'' ,
15181530 r'if mode\(\) == "load" then' ,
15191531 ] + modloadmsg_lua + [
@@ -1552,6 +1564,9 @@ def test_toy_module_fulltxt(self):
15521564 r'prepend-path SOMEPATH \$root/foo/bar' ,
15531565 r'prepend-path SOMEPATH \$root/baz' ,
15541566 r'prepend-path SOMEPATH \$root' ,
1567+ r'append-path SOMEPATH_APPEND \$root/qux/fred' ,
1568+ r'append-path SOMEPATH_APPEND \$root/thud' ,
1569+ r'append-path SOMEPATH_APPEND \$root' ,
15551570 r'' ,
15561571 r'if { \[ module-info mode load \] } {' ,
15571572 ] + modloadmsg_tcl + [
0 commit comments