aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests/macro.rs (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-11-28Add tests for named arguments in macro callsLibravatar Guillaume Gomez1-0/+28
2023-10-12Add test for macro self argumentLibravatar max1-0/+12
Signed-off-by: max <gmx.sht@gmail.com>
2023-06-12Allow macros to be defined and called without argumentsLibravatar mataha1-0/+10
This commit introduces a shorthand for defining and calling macros when using them as a reusable substitute for variables assigned complex values (e.g. string literals with or without newline escapes). The use-case is formatting - from my experience it's easier to visually parse a `macro` `endmacro` block than a multiline variable assignment. Signed-off-by: mataha <mataha@users.noreply.github.com>
2022-04-29Allow `{% endmacro name %}`Libravatar Bastien Orivel1-1/+1
Just migrated a repo from tera to askama and this was one of the only things that was different. This is also coherent with `{% block %}` for which I added the same feature years ago.
2021-07-30Issue #379 was fixedLibravatar René Kijewski1-0/+10
This PR adds the tests by @msrd0 <git@msrd0.de> that failed before. The error was fixed somewhen between f23162a and now, so these tests serve to prevent regressions in the future. I simplified the tests very slightly to omit whitespaces in the output.
2021-06-22Fix code generation for macro calls that store args in variables.Libravatar Ryan Kelly1-0/+10
2020-12-01Fixed implicit borrow of expressions (#390)Libravatar Christian Vallentin1-0/+10
2018-12-08Use 2018 edition idiomsLibravatar Dirkjan Ochtman1-2/+0
2018-12-08Remove unused macro_use attributesLibravatar Dirkjan Ochtman1-1/+0
2018-09-07Fix deep nested imports in macro callsLibravatar bott1-0/+10
2018-09-02Add test for nested macro calls into different scopeLibravatar bott1-0/+10
2017-10-01Fix whitespace handling for macros and imports (#55)Libravatar larros1-1/+1
Resolves https://github.com/djc/askama/issues/52. * Fix of review comments
2017-09-26Add support for importing template files with macros (#51)Libravatar larros1-0/+12
* Fix review comments for macro imports
2017-08-23Forgot to remove debugging cruft, againLibravatar Dirkjan Ochtman1-1/+1
2017-08-22Add test for basic macro useLibravatar Dirkjan Ochtman1-0/+16