public void TestEarlyEvalOfMapInIfExpr()
{
string templates =
"m ::= [\n" +
" \"parrt\": \"value\",\n" +
" default: \"other\"\n" +
"]\n" +
"main(x) ::= << p<x>t: <m.({p<x>t})>, <if(m.({p<x>t}))>if<else>else<endif> >>\n";
writeFile(tmpdir, "t.stg", templates);
TemplateGroup group = new TemplateGroupFile(tmpdir + "/t.stg");
Template st = group.GetInstanceOf("main");
st.Add("x", null);
string s = st.Render();
Assert.AreEqual(" pt: other, if ", s);
st.Add("x", "arr");
s = st.Render();
Assert.AreEqual(" parrt: value, if ", s);
}