@@ -221,8 +221,8 @@ QUnit.test( "broken selectors throw", function( assert ) {
221
221
. appendTo ( "#qunit-fixture" ) ;
222
222
223
223
broken ( "Attribute equals non-value" , "input[name=]" ) ;
224
- broken ( "Attribute equals unquoted non-identifer " , "input[name=foo.baz]" ) ;
225
- broken ( "Attribute equals unquoted non-identifer " , "input[name=foo[baz]]" ) ;
224
+ broken ( "Attribute equals unquoted non-identifier " , "input[name=foo.baz]" ) ;
225
+ broken ( "Attribute equals unquoted non-identifier " , "input[name=foo[baz]]" ) ;
226
226
broken ( "Attribute equals bad string" , "input[name=''double-quoted'']" ) ;
227
227
broken ( "Attribute equals bad string" , "input[name='apostrophe'd']" ) ;
228
228
} ) ;
@@ -638,7 +638,7 @@ QUnit.test( "attributes - hyphen-prefix matches", function( assert ) {
638
638
} ) ;
639
639
640
640
QUnit . test ( "attributes - special characters" , function ( assert ) {
641
- assert . expect ( 14 ) ;
641
+ assert . expect ( 16 ) ;
642
642
643
643
var attrbad ;
644
644
var div = document . createElement ( "div" ) ;
@@ -656,6 +656,7 @@ QUnit.test( "attributes - special characters", function( assert ) {
656
656
"<input type='hidden' id='attrbad_space' name='foo bar'/>" +
657
657
"<input type='hidden' id='attrbad_dot' value='2' name='foo.baz'/>" +
658
658
"<input type='hidden' id='attrbad_brackets' value='2' name='foo[baz]'/>" +
659
+ "<input type='hidden' id='attrbad_leading_digits' name='agent' value='007'/>" +
659
660
"<input type='hidden' id='attrbad_injection' data-attr='foo_baz']'/>" +
660
661
"<input type='hidden' id='attrbad_quote' data-attr='''/>" +
661
662
"<input type='hidden' id='attrbad_backslash' data-attr='\'/>" +
@@ -678,6 +679,13 @@ QUnit.test( "attributes - special characters", function( assert ) {
678
679
q ( "attrbad_injection" ) ,
679
680
"string containing quote and right bracket" ) ;
680
681
682
+ assert . deepEqual ( jQuery . find ( "input[value=\\30 \\30\\37 ]" , null , null , attrbad ) ,
683
+ q ( "attrbad_leading_digits" ) ,
684
+ "identifier containing escaped leading digits with whitespace termination" ) ;
685
+ assert . deepEqual ( jQuery . find ( "input[value=\\00003007]" , null , null , attrbad ) ,
686
+ q ( "attrbad_leading_digits" ) ,
687
+ "identifier containing escaped leading digits without whitespace termination" ) ;
688
+
681
689
assert . deepEqual ( jQuery . find ( "input[data-attr='\\'']" , null , null , attrbad ) ,
682
690
q ( "attrbad_quote" ) ,
683
691
"string containing quote" ) ;
0 commit comments