aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRichard Gibson <richard.gibson@gmail.com>2013-05-13 21:55:00 -0400
committerRichard Gibson <richard.gibson@gmail.com>2013-05-13 21:55:00 -0400
commitd8a35011ec05ed3493a85c1bd699902893cd437c (patch)
treec6ac361bb47a09b9f7fe15cd2a672c8bf8b3e908 /test
parentd80c6aca18240281f553a35d727c2891d4bc2b57 (diff)
downloadjquery-d8a35011ec05ed3493a85c1bd699902893cd437c.tar.gz
jquery-d8a35011ec05ed3493a85c1bd699902893cd437c.zip
Fix #13835: classes separated by form feed
Diffstat (limited to 'test')
-rw-r--r--test/unit/attributes.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/unit/attributes.js b/test/unit/attributes.js
index 062dd504c..84ac8c2b2 100644
--- a/test/unit/attributes.js
+++ b/test/unit/attributes.js
@@ -1353,6 +1353,26 @@ test( "contents().hasClass() returns correct values", function() {
ok( !$contents.hasClass("undefined"), "Did not find 'undefined' in $contents (correctly)" );
});
+test( "hasClass correctly interprets non-space separators (#13835)", function() {
+ expect( 4 );
+
+ var
+ map = {
+ tab: "&#9;",
+ "line-feed": "&#10;",
+ "form-feed": "&#12;",
+ "carriage-return": "&#13;"
+ },
+ classes = jQuery.map( map, function( separator, label ) {
+ return " " + separator + label + separator + " ";
+ }),
+ $div = jQuery( "<div class='" + classes + "'></div>" );
+
+ jQuery.each( map, function( label ) {
+ ok( $div.hasClass( label ), label.replace( "-", " " ) );
+ });
+});
+
test( "coords returns correct values in IE6/IE7, see #10828", function() {
expect( 1 );