From 0aabbe6fd5e2efeaef54f2e2cb525fb3fded4099 Mon Sep 17 00:00:00 2001 From: mytharcher Date: Mon, 10 Sep 2012 15:26:05 +0800 Subject: [PATCH] Add test case for #19. --- test/template.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/template.js b/test/template.js index de216f0..e4232aa 100644 --- a/test/template.js +++ b/test/template.js @@ -133,6 +133,14 @@ test("merge", function() { er.template.merge( el, 'mergeTest7' ); equals(el.innerHTML, 'invalid', 'merge,进入else分支'); + er.template.parse('${num}'); + er.context.set( 'num', 0 ); + er.template.merge( el, 'mergeTest9' ); + equals(el.innerHTML, '0', '不等于比较,不相等时'); + er.context.set( 'num', 3 ); + er.template.merge( el, 'mergeTest9' ); + equals(el.innerHTML, '', '不等于比较,相等时'); + er.template.parse('${num}'); er.context.set( 'num', -1 ); er.template.merge( el, 'mergeTest7_2' );