summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin Krizek <martin.krizek@gmail.com>2021-10-13 16:56:48 +0200
committerDavid Lord <davidism@gmail.com>2021-11-10 11:17:33 -0800
commit2903565262e6c8971e612a2717feb430e284e4ac (patch)
tree9afc5d16acee5c2802df206c56e62849960869ad /tests
parentb285d0c2e65f546d340b7cac75dbb9f74267bc23 (diff)
downloadjinja2-2903565262e6c8971e612a2717feb430e284e4ac.tar.gz
support native types in macros
Diffstat (limited to 'tests')
-rw-r--r--tests/test_nativetypes.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_nativetypes.py b/tests/test_nativetypes.py
index 9bae938..8c85252 100644
--- a/tests/test_nativetypes.py
+++ b/tests/test_nativetypes.py
@@ -153,3 +153,10 @@ def test_leading_spaces(env):
t = env.from_string(" {{ True }}")
result = t.render()
assert result == " True"
+
+
+def test_macro(env):
+ t = env.from_string("{%- macro x() -%}{{- [1,2] -}}{%- endmacro -%}{{- x()[1] -}}")
+ result = t.render()
+ assert result == 2
+ assert isinstance(result, int)