From 03d2eb96aea382e2901a8bc369125f7b7869bf03 Mon Sep 17 00:00:00 2001 From: Andrew Theken Date: Wed, 9 Sep 2015 10:26:58 -0400 Subject: [PATCH] Adding test for inverted group variable handling. --- Mustachio.Tests/TemplateFixture.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Mustachio.Tests/TemplateFixture.cs b/Mustachio.Tests/TemplateFixture.cs index ed58d42..f2675ff 100644 --- a/Mustachio.Tests/TemplateFixture.cs +++ b/Mustachio.Tests/TemplateFixture.cs @@ -105,5 +105,22 @@ public void TemplateRendersWithComplextEachPath() "
  • name 1 and version 1 and has a CEO: Smith
  • " + "
  • name 2 and version 2 and has a CEO: Smith
  • ", result); } + + [Fact] + public void TemplateShouldProcessVariablesInInvertedGroup() + { + var model = new Dictionary + { + { "not_here" , false }, + { "placeholder" , "a placeholder value" } + }; + + var template = "{{^not_here}}{{../placeholder}}{{/not_here}}"; + + var result = Parser.Parse(template)(model); + + Assert.Equal("a placeholder value", result); + + } } }