Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

Commit

Permalink
Revert test case deleted.
Browse files Browse the repository at this point in the history
  • Loading branch information
mytharcher committed Sep 3, 2012
1 parent 5368fd0 commit 97806bc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ test("merge", function() {
er.context.set( 'myList', [1,2,3,4,5] );
er.template.merge( el, 'mergeTest6_3' );
equals(el.innerHTML, '1,0|2,1|3,2|4,3|5,4', 'merge,for遍历数组,带数组索引');

er.template.parse('<!-- target:mergeTest6_4 --><!-- for: ${myObject.myList} as ${item} -->${item}<!-- /for -->');
er.context.set( 'myObject', {myList: [1,2,3,4,5]} );
er.template.merge( el, 'mergeTest6_4' );
equals(el.innerHTML, '12345', 'for遍历多级对象数组');

er.template.parse('<!-- target:mergeTest7 --><!-- if: ${num} > 0 -->${num}<!--elif: ${num} == 0-->zero<!--else-->invalid<!-- /if -->');
er.context.set( 'num', 1 );
Expand Down

0 comments on commit 97806bc

Please sign in to comment.