From 6d1cf5e43dbf5d26506585db1f801064051f49a4 Mon Sep 17 00:00:00 2001 From: René Kijewski Date: Fri, 30 Jul 2021 17:36:29 +0200 Subject: Issue #379 was fixed This PR adds the tests by @msrd0 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. --- testing/templates/macro-import-str-cmp-macro.html | 13 +++++++++++++ testing/templates/macro-import-str-cmp.html | 15 +++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 testing/templates/macro-import-str-cmp-macro.html create mode 100644 testing/templates/macro-import-str-cmp.html (limited to 'testing/templates') diff --git a/testing/templates/macro-import-str-cmp-macro.html b/testing/templates/macro-import-str-cmp-macro.html new file mode 100644 index 0000000..a951f93 --- /dev/null +++ b/testing/templates/macro-import-str-cmp-macro.html @@ -0,0 +1,13 @@ +{% macro strcmp0(s, other) -%} + {%- if s == "foo" -%} + foo + {%- else if s == other -%} + other + {%- else -%} + neither + {%- endif -%} +{% endmacro %} + +{% macro strcmp(s) %} + {%- call strcmp0(s, "bar") -%} +{% endmacro %} diff --git a/testing/templates/macro-import-str-cmp.html b/testing/templates/macro-import-str-cmp.html new file mode 100644 index 0000000..648a0cf --- /dev/null +++ b/testing/templates/macro-import-str-cmp.html @@ -0,0 +1,15 @@ +{%- import "macro-import-str-cmp-macro.html" as macros -%} + +A + +{%- call macros::strcmp("foo") -%} + +B + +{%- call macros::strcmp("bar") -%} + +C + +{%- call macros::strcmp("cat") -%} + +D -- cgit