From: Michał Gołębiowski-Owczarek Date: Mon, 21 Oct 2019 17:03:03 +0000 (+0200) Subject: Selector: Add a test for throwing on post-comma invalid selectors X-Git-Tag: 4.0.0-beta~238 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6eee5f7f181f9ebf5aa428e96356667e3cf7ddbd;p=jquery.git Selector: Add a test for throwing on post-comma invalid selectors Sizzle's PR jquery/sizzle#456 introduced a test catching not throwing on badly-escaped identifiers by Firefox 3.6-5. Unfortunately, it was placed just before a test Opera 10-11 failed, making Opera fail quicker and not adding a post-comma invalid selector to rbuggyQSA. The issue was fixed in jquery/sizzle#463. This jQuery commit backports the test that Sizzle PR added as no workarounds are needed in browsers jQuery supports. Closes gh-4516 Ref jquery/sizzle#456 Ref jquery/sizzle#463 --- diff --git a/test/unit/selector.js b/test/unit/selector.js index dafb45e8a..f6e977094 100644 --- a/test/unit/selector.js +++ b/test/unit/selector.js @@ -179,7 +179,7 @@ QUnit.test( "XML Document Selectors", function( assert ) { } ); QUnit.test( "broken selectors throw", function( assert ) { - assert.expect( 32 ); + assert.expect( 33 ); function broken( name, selector ) { assert.throws( function() { @@ -197,6 +197,7 @@ QUnit.test( "broken selectors throw", function( assert ) { broken( "Broken Selector", "," ); broken( "Broken Selector", ",a" ); broken( "Broken Selector", "a," ); + broken( "Post-comma invalid selector", "*,:x" ); broken( "Identifier with bad escape", "foo\\\fbaz" ); broken( "Broken Selector", "[id=012345678901234567890123456789" ); broken( "Doesn't exist", ":visble" );