| 829 | } |
| 830 | |
| 831 | static void test_macros(testing & t) { |
| 832 | test_template(t, "simple macro", |
| 833 | "{% macro greet(name) %}Hello {{ name }}{% endmacro %}{{ greet('World') }}", |
| 834 | json::object(), |
| 835 | "Hello World" |
| 836 | ); |
| 837 | |
| 838 | test_template(t, "macro default arg", |
| 839 | "{% macro greet(name='Guest') %}Hi {{ name }}{% endmacro %}{{ greet() }}", |
| 840 | json::object(), |
| 841 | "Hi Guest" |
| 842 | ); |
| 843 | } |
| 844 | |
| 845 | static void test_namespace(testing & t) { |
| 846 | test_template(t, "namespace counter", |
nothing calls this directly
no test coverage detected