From c5c8d9d37760b65c35adecb011c73d6dce7cdfe2 Mon Sep 17 00:00:00 2001 From: mytharcher Date: Mon, 3 Sep 2012 11:27:30 +0800 Subject: [PATCH] Add test case for issue #17. --- test/template.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/template.js b/test/template.js index 10cd752..5608515 100644 --- a/test/template.js +++ b/test/template.js @@ -117,11 +117,6 @@ test("merge", function() { er.template.merge( el, 'mergeTest6_3' ); equals(el.innerHTML, '1,0|2,1|3,2|4,3|5,4', 'merge,for遍历数组,带数组索引'); - er.template.parse('${item}'); - er.context.set( 'myObject', {myList: [1,2,3,4,5]} ); - er.template.merge( el, 'mergeTest6_4' ); - equals(el.innerHTML, '12345', 'for遍历多级对象数组'); - er.template.parse('${num}zeroinvalid'); er.context.set( 'num', 1 ); er.template.merge( el, 'mergeTest7' ); @@ -132,6 +127,11 @@ test("merge", function() { er.context.set( 'num', -1 ); er.template.merge( el, 'mergeTest7' ); equals(el.innerHTML, 'invalid', 'merge,进入else分支'); + + er.template.parse('${num}'); + er.context.set( 'num', -1 ); + er.template.merge( el, 'mergeTest7_2' ); + equals(el.innerHTML, '-1', '负数也可以比较'); er.template.parse('1'); er.context.set( 'num', 0 );