@@ -179,11 +179,11 @@ QUnit.test( "XML Document Selectors", function( assert ) {
179
179
} ) ;
180
180
181
181
QUnit . test ( "broken selectors throw" , function ( assert ) {
182
- assert . expect ( 31 ) ;
182
+ assert . expect ( 33 ) ;
183
183
184
184
function broken ( name , selector ) {
185
185
assert . throws ( function ( ) {
186
- jQuery . find ( selector ) ;
186
+ jQuery ( selector ) ;
187
187
} , name + ": " + selector ) ;
188
188
}
189
189
@@ -197,6 +197,8 @@ QUnit.test( "broken selectors throw", function( assert ) {
197
197
broken ( "Broken Selector" , "," ) ;
198
198
broken ( "Broken Selector" , ",a" ) ;
199
199
broken ( "Broken Selector" , "a," ) ;
200
+ broken ( "Post-comma invalid selector" , "*,:x" ) ;
201
+ broken ( "Identifier with bad escape" , "foo\\\fbaz" ) ;
200
202
broken ( "Broken Selector" , "[id=012345678901234567890123456789" ) ;
201
203
broken ( "Doesn't exist" , ":visble" ) ;
202
204
broken ( "Nth-child" , ":nth-child" ) ;
@@ -214,14 +216,14 @@ QUnit.test( "broken selectors throw", function( assert ) {
214
216
broken ( "Last-last-child" , ":last-last-child" ) ;
215
217
broken ( "Only-last-child" , ":only-last-child" ) ;
216
218
217
- // Make sure attribute value quoting works correctly. See: # 6093
219
+ // Make sure attribute value quoting works correctly. See: trac- 6093
218
220
jQuery ( "<input type='hidden' value='2' name='foo.baz' id='attrbad1'/>" +
219
221
"<input type='hidden' value='2' name='foo[baz]' id='attrbad2'/>" )
220
222
. appendTo ( "#qunit-fixture" ) ;
221
223
222
224
broken ( "Attribute equals non-value" , "input[name=]" ) ;
223
- broken ( "Attribute equals unquoted non-identifer " , "input[name=foo.baz]" ) ;
224
- broken ( "Attribute equals unquoted non-identifer " , "input[name=foo[baz]]" ) ;
225
+ broken ( "Attribute equals unquoted non-identifier " , "input[name=foo.baz]" ) ;
226
+ broken ( "Attribute equals unquoted non-identifier " , "input[name=foo[baz]]" ) ;
225
227
broken ( "Attribute equals bad string" , "input[name=''double-quoted'']" ) ;
226
228
broken ( "Attribute equals bad string" , "input[name='apostrophe'd']" ) ;
227
229
} ) ;
@@ -637,14 +639,14 @@ QUnit.test( "attributes - hyphen-prefix matches", function( assert ) {
637
639
} ) ;
638
640
639
641
QUnit . test ( "attributes - special characters" , function ( assert ) {
640
- assert . expect ( 14 ) ;
642
+ assert . expect ( 16 ) ;
641
643
642
644
var attrbad ;
643
645
var div = document . createElement ( "div" ) ;
644
646
645
- // trac-3279
647
+ // trac-3729
646
648
div . innerHTML = "<div id='foo' xml:test='something'></div>" ;
647
- assert . deepEqual ( jQuery . find ( "[xml\\:test]" , div ) ,
649
+ assert . deepEqual ( jQuery ( "[xml\\:test]" , div ) . get ( ) ,
648
650
[ div . firstChild ] ,
649
651
"attribute name containing colon" ) ;
650
652
@@ -655,6 +657,7 @@ QUnit.test( "attributes - special characters", function( assert ) {
655
657
"<input type='hidden' id='attrbad_space' name='foo bar'/>" +
656
658
"<input type='hidden' id='attrbad_dot' value='2' name='foo.baz'/>" +
657
659
"<input type='hidden' id='attrbad_brackets' value='2' name='foo[baz]'/>" +
660
+ "<input type='hidden' id='attrbad_leading_digits' name='agent' value='007'/>" +
658
661
"<input type='hidden' id='attrbad_injection' data-attr='foo_baz']'/>" +
659
662
"<input type='hidden' id='attrbad_quote' data-attr='''/>" +
660
663
"<input type='hidden' id='attrbad_backslash' data-attr='\'/>" +
@@ -677,6 +680,13 @@ QUnit.test( "attributes - special characters", function( assert ) {
677
680
q ( "attrbad_injection" ) ,
678
681
"string containing quote and right bracket" ) ;
679
682
683
+ assert . deepEqual ( jQuery . find ( "input[value=\\30 \\30\\37 ]" , null , null , attrbad ) ,
684
+ q ( "attrbad_leading_digits" ) ,
685
+ "identifier containing escaped leading digits with whitespace termination" ) ;
686
+ assert . deepEqual ( jQuery . find ( "input[value=\\00003007]" , null , null , attrbad ) ,
687
+ q ( "attrbad_leading_digits" ) ,
688
+ "identifier containing escaped leading digits without whitespace termination" ) ;
689
+
680
690
assert . deepEqual ( jQuery . find ( "input[data-attr='\\'']" , null , null , attrbad ) ,
681
691
q ( "attrbad_quote" ) ,
682
692
"string containing quote" ) ;
0 commit comments