dojo.provide("dojox.dtl.tests.html.buffer");
dojo.require("dojox.dtl.html");
dojo.require("dojox.dtl.Context");
dojo.require("dojox.dtl.tests.html.util");
doh.register("dojox.dtl.html.buffer",
[
function test_insertion_order_text(t){
var dd = dojox.dtl;
var context = new dd.Context({
first: false,
last: false
});
var template = new dd.HtmlTemplate("
{% if first %}first{% endif %}middle{% if last %}last{% endif %}
");
t.is("middle
", dd.tests.html.util.render(template, context));
context.first = true;
t.is("firstmiddle
", dd.tests.html.util.render(template, context));
context.first = false;
context.last = true;
t.is("middlelast
", dd.tests.html.util.render(template, context));
context.first = true;
t.is("firstmiddlelast
", dd.tests.html.util.render(template, context));
}
]
);