mirror of
https://github.com/tests-always-included/mo.git
synced 2025-11-19 23:34:32 +01:00
Allowing access to globals while in a loop
This used to make a name like DATA.0.STR. Since bash doesn't like using multi-dimensional arrays, we can shortcut things and just assume that STR referes to the global variable here. This closes issue #7
This commit is contained in:
2
tests/globals-in-loop.env
Normal file
2
tests/globals-in-loop.env
Normal file
@@ -0,0 +1,2 @@
|
||||
STR=abc
|
||||
DATA=(111 222)
|
||||
6
tests/globals-in-loop.expected
Normal file
6
tests/globals-in-loop.expected
Normal file
@@ -0,0 +1,6 @@
|
||||
Issue #7
|
||||
abc
|
||||
Item: 111
|
||||
String: abc
|
||||
Item: 222
|
||||
String: abc
|
||||
6
tests/globals-in-loop.template
Normal file
6
tests/globals-in-loop.template
Normal file
@@ -0,0 +1,6 @@
|
||||
Issue #7
|
||||
{{STR}}
|
||||
{{#DATA}}
|
||||
Item: {{.}}
|
||||
String: {{STR}}
|
||||
{{/DATA}}
|
||||
Reference in New Issue
Block a user