Skip to content

Commit 3d52e6a

Browse files
committed
Fix template for lua files, add check for delimiters in tests
1 parent 9e6642d commit 3d52e6a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

easybuild/tools/module_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,7 @@ class ModuleGeneratorLua(ModuleGenerator):
11701170

11711171
PATH_JOIN_TEMPLATE = 'pathJoin(root, "%s")'
11721172
UPDATE_PATH_TEMPLATE = '%s_path("%s", %s)'
1173-
UPDATE_PATH_TEMPLATE_DELIM = '%s_path {"%s", delim="%s")'
1173+
UPDATE_PATH_TEMPLATE_DELIM = '%s_path("%s", %s, "%s")'
11741174

11751175
START_STR = '[==['
11761176
END_STR = ']==]'

test/framework/easyblock.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,9 +1338,9 @@ def test_make_module_step(self):
13381338
vals = [vals]
13391339
for val in vals:
13401340
if get_module_syntax() == 'Tcl':
1341-
regex = re.compile(r'^prepend-path\s+%s\s+\$root/%s$' % (key, val), re.M)
1341+
regex = re.compile(r'^prepend-path\s+(-d ".")?%s\s+\$root/%s$' % (key, val), re.M)
13421342
elif get_module_syntax() == 'Lua':
1343-
regex = re.compile(r'^prepend_path\("%s", pathJoin\(root, "%s"\)\)$' % (key, val), re.M)
1343+
regex = re.compile(r'^prepend_path\("%s", pathJoin\(root, "%s"\)(, ".")\)$' % (key, val), re.M)
13441344
else:
13451345
self.fail("Unknown module syntax: %s" % get_module_syntax())
13461346
self.assertTrue(regex.search(txt), "Pattern %s found in %s" % (regex.pattern, txt))
@@ -1353,9 +1353,9 @@ def test_make_module_step(self):
13531353
vals = [vals]
13541354
for val in vals:
13551355
if get_module_syntax() == 'Tcl':
1356-
regex = re.compile(r'^append-path\s+%s\s+\$root/%s$' % (key, val), re.M)
1356+
regex = re.compile(r'^append-path\s+(-d ".")?%s\s+\$root/%s$' % (key, val), re.M)
13571357
elif get_module_syntax() == 'Lua':
1358-
regex = re.compile(r'^append_path\("%s", pathJoin\(root, "%s"\)\)$' % (key, val), re.M)
1358+
regex = re.compile(r'^append_path\("%s", pathJoin\(root, "%s"\)(, ".")\)$' % (key, val), re.M)
13591359
else:
13601360
self.fail("Unknown module syntax: %s" % get_module_syntax())
13611361
self.assertTrue(regex.search(txt), "Pattern %s found in %s" % (regex.pattern, txt))

0 commit comments

Comments
 (0)