Browse files

Testcase for issue #38

  • Loading branch information...
1 parent 2d98192 commit 5f22278b05ba416f58f731fd06fc8694fc1d6be8 @alexeyten alexeyten committed Apr 4, 2012
Showing with 22 additions and 3 deletions.
  1. +12 −0 tests/escaping.05.yate
  2. +10 −3 tests/tests.js
View
12 tests/escaping.05.yate
@@ -0,0 +1,12 @@
+var = "<"
+var2 = "&"
+match / {
+ <tag a="<" b="{var}">
+ @c=var
+ </>
+ <tag a="&" b="{var2}">
+ @c=var2
+ </>
+ <tag a="<" b="{var}"/>
+ <tag a="&" b="{var2}"/>
+}
View
13 tests/tests.js
@@ -144,14 +144,21 @@ module.exports = [
result: '<h1>&lt;b&gt;Some &amp;text&lt;/b&gt;</h1>'
},
{
+ description: 'escape xml text',
+ yate: 'escaping.03.yate',
+ result: '<h1>&lt;b&gt;Some &amp;text&lt;/b&gt;</h1>'
+ },
+ {
description: 'escape text inside interpolation',
yate: 'escaping.04.yate',
result: '&lt;b&gt;Some &amp;text&lt;/b&gt;'
},
{
- description: 'escape xml text',
- yate: 'escaping.03.yate',
- result: '<h1>&lt;b&gt;Some &amp;text&lt;/b&gt;</h1>'
+ description: 'attributes overescaping',
+ yate: 'escaping.05.yate',
+ result: '<tag a="&lt;" b="&lt;" c="&lt;"></tag><tag a="&amp;" b="&amp;" c="&amp;"></tag>'+
+ '<tag a="&lt;" b="&lt;"></tag><tag a="&amp;" b="&amp;"></tag>',
+ known: true
},
]
},

0 comments on commit 5f22278

Please sign in to comment.