From: Juriy Zaytsev Date: Tue, 9 Feb 2010 00:04:28 +0000 (-0500) Subject: Add tests for removing quotes around attributes. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=6413520f630ddcc18bbb722fcbde6bec02e6ebf4;p=html-minifier.git Add tests for removing quotes around attributes. --- diff --git a/tests/index.html b/tests/index.html index 1e75ad9..0c1480e 100644 --- a/tests/index.html +++ b/tests/index.html @@ -32,18 +32,13 @@ var expected = ''; equals(actual, expected); - }); - - test('Short doctype with HTML 5 doctype', function() { + equals(minify('', { shouldUseShortDoctype: true }), ''); - }); - - test('Short doctype off', function(){ - var html401doctype = ''; - var actual = minify(html401doctype, { shouldUseShortDoctype: false }); - var expected = ''; - equals(actual, expected);; + actual = minify(html401doctype, { shouldUseShortDoctype: false }); + expected = ''; + + equals(actual, expected); }); test('Remove comments', function(){ @@ -100,6 +95,20 @@ equals(minify(input, { shouldCleanAttributes: true }), '

foo bar baz

'); }); + test('remove attribute quotes', function(){ + var input = '

foo

'; + equals(minify(input, { shouldRemoveAttributeQuotes: true }), '

foo

'); + + input = ''; + equals(minify(input, { shouldRemoveAttributeQuotes: true }), ''); + + input = 'x'; + equals(minify(input, { shouldRemoveAttributeQuotes: true }), 'x'); + + input = '\nfoo\n\n'; + equals(minify(input, { shouldRemoveAttributeQuotes: true }), '\nfoo\n\n'); + }); + })(this);