summaryrefslogtreecommitdiffhomepage
path: root/tests/custom/03_stdlib/35_include
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-03-14 16:25:30 +0100
committerJo-Philipp Wich <jo@mein.io>2022-03-14 19:33:40 +0100
commitb4a1fd5bb4b24cec6b1410209de3f9511a00ff28 (patch)
tree016872e56c12f5edb3df12cf9a9cc87680f2bcc5 /tests/custom/03_stdlib/35_include
parent46188077ef727c21513008f4e0c42e8cb211e90e (diff)
lib: adjust require(), render() and include() raw mode semantics
- Let `require()` always evaluate the executed code in raw mode - Let `render()` always evaluate the executed code in template mode - Let `include()` inherit the raw mode semantics of the calling scope Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'tests/custom/03_stdlib/35_include')
-rw-r--r--tests/custom/03_stdlib/35_include32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/custom/03_stdlib/35_include b/tests/custom/03_stdlib/35_include
index 6d808f2..1d428f1 100644
--- a/tests/custom/03_stdlib/35_include
+++ b/tests/custom/03_stdlib/35_include
@@ -171,3 +171,35 @@ In line 12, byte 8:
-- End --
+
+
+Ensure that included files inherit the parse mode of their calling file.
+
+-- Testcase --
+{% include("files/inctest.uc"); %}
+-- End --
+
+-- File inctest.uc --
+print("Test\n");
+-- End --
+
+-- Expect stdout --
+print("Test\n");
+-- End --
+
+
+-- Testcase --
+include("files/inctest.uc");
+-- End --
+
+-- Args --
+-R
+-- End --
+
+-- File inctest.uc --
+print("Test\n");
+-- End --
+
+-- Expect stdout --
+Test
+-- End --