diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-03-14 16:25:30 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-03-14 19:33:40 +0100 |
commit | b4a1fd5bb4b24cec6b1410209de3f9511a00ff28 (patch) | |
tree | 016872e56c12f5edb3df12cf9a9cc87680f2bcc5 /tests/custom/03_stdlib/29_require | |
parent | 46188077ef727c21513008f4e0c42e8cb211e90e (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/29_require')
-rw-r--r-- | tests/custom/03_stdlib/29_require | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/tests/custom/03_stdlib/29_require b/tests/custom/03_stdlib/29_require index 681f3f7..4fb4216 100644 --- a/tests/custom/03_stdlib/29_require +++ b/tests/custom/03_stdlib/29_require @@ -42,15 +42,13 @@ Returns the value returned by the invoked module code (typically an object). -- End -- -- File require/test/module.uc -- -{% - print("This is require.test.module running!\n\n"); +print("This is require.test.module running!\n\n"); - return { - greeting: function(name) { - printf("Hello, %s!\n", name); - } - }; -%} +return { + greeting: function(name) { + printf("Hello, %s!\n", name); + } +}; -- End -- -- Expect stdout -- @@ -139,19 +137,17 @@ A compilation error in the module triggers an exception. -- End -- -- File require/test/broken.uc -- -{% - // Unclosed object to force syntax error - return { -%} +// Unclosed object to force syntax error +return { -- End -- -- Expect stderr -- Unable to compile module '.../require/test/broken.uc': Syntax error: Expecting label -In line 3, byte 11: +In line 2, byte 10: - ` return {` - Near here --^ + `return {` + ^-- Near here |