Skip to content

Commit

Permalink
add tests for escape
Browse files Browse the repository at this point in the history
  • Loading branch information
Karan Goel committed Dec 1, 2014
1 parent 3a9c74a commit 85e0e8e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/sanitizer_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,18 @@ void testStripLow() {
}


void testEscape() {
test({
'sanitizer': s.escape,
'args': [],
'expect': {
'<img alt="foo&bar">': '&lt;img alt=&quot;foo&amp;bar&quot;&gt;',
"<img alt='foo&bar'>": '&lt;img alt=&#x27;foo&amp;bar&#x27;&gt;'
}
});
}


void main() {
testToString();
testToDate();
Expand All @@ -210,6 +222,7 @@ void main() {
testWhitelist();
testBlacklist();
testStripLow();
testEscape();

print('-------------------------------------');
print('All tests in sanitizer.dart complete.');
Expand Down

0 comments on commit 85e0e8e

Please sign in to comment.