From 509e3d0edd3d94099f8ea9237f6412082a745f20 Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Wed, 30 Jun 2021 22:50:37 +0800 Subject: [PATCH] (test) add test case for invert tag --- src/helpers/helper_if.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/helpers/helper_if.rs b/src/helpers/helper_if.rs index bf8b29b24..5a6e42fc0 100644 --- a/src/helpers/helper_if.rs +++ b/src/helpers/helper_if.rs @@ -141,5 +141,11 @@ mod test { hbs.render_template("{{#if a}}x{{/if}}\ny", &json!({"a": true})) .unwrap() ); + + assert_eq!( + "y\nz", + hbs.render_template("{{#if a}}\nx\n{{^}}\ny\n{{/if}}\nz", &json!({"a": false})) + .unwrap() + ); } }