Skip to content

Commit 03d2eb9

Browse files
committed
Adding test for inverted group variable handling.
1 parent 8436d7c commit 03d2eb9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Mustachio.Tests/TemplateFixture.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,22 @@ public void TemplateRendersWithComplextEachPath()
105105
"<li>name 1 and version 1 and has a CEO: Smith</li>" +
106106
"<li>name 2 and version 2 and has a CEO: Smith</li>", result);
107107
}
108+
109+
[Fact]
110+
public void TemplateShouldProcessVariablesInInvertedGroup()
111+
{
112+
var model = new Dictionary<String, object>
113+
{
114+
{ "not_here" , false },
115+
{ "placeholder" , "a placeholder value" }
116+
};
117+
118+
var template = "{{^not_here}}{{../placeholder}}{{/not_here}}";
119+
120+
var result = Parser.Parse(template)(model);
121+
122+
Assert.Equal("a placeholder value", result);
123+
124+
}
108125
}
109126
}

0 commit comments

Comments
 (0)