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

Commit

Permalink
Add test case for erik168#19.
Browse files Browse the repository at this point in the history
  • Loading branch information
mytharcher committed Sep 10, 2012
1 parent 97806bc commit 0aabbe6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ test("merge", function() {
er.template.merge( el, 'mergeTest7' );
equals(el.innerHTML, 'invalid', 'merge,进入else分支');

er.template.parse('<!-- target:mergeTest9 --><!-- if: ${num} != 3 -->${num}<!-- /if -->');
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('<!-- target:mergeTest7_2 --><!-- if: ${num} == -1 -->${num}<!-- /if -->');
er.context.set( 'num', -1 );
er.template.merge( el, 'mergeTest7_2' );
Expand Down

0 comments on commit 0aabbe6

Please sign in to comment.