aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/selector.js
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2009-02-15 21:13:33 +0000
committerJohn Resig <jeresig@gmail.com>2009-02-15 21:13:33 +0000
commit20827707a94c8569bcc422f71bf5b37bc55695df (patch)
tree2d256b66c935f7bc2f709ecd3c055a1b15b965dd /test/unit/selector.js
parentf9a7cfacf7d609620fd5ce8a939268e93ef423a1 (diff)
downloadjquery-20827707a94c8569bcc422f71bf5b37bc55695df.tar.gz
jquery-20827707a94c8569bcc422f71bf5b37bc55695df.zip
Added fixes for two different :not() bugs. One with p:not(p.foo) failing and another with a weird combination of multiple selectors and filters. Fixes jQuery bug #4101.
Diffstat (limited to 'test/unit/selector.js')
-rw-r--r--test/unit/selector.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/unit/selector.js b/test/unit/selector.js
index 2539e4d3b..72511eb66 100644
--- a/test/unit/selector.js
+++ b/test/unit/selector.js
@@ -296,7 +296,7 @@ test("attributes", function() {
});
test("pseudo (:) selectors", function() {
- expect(53);
+ expect(67);
t( "First Child", "p:first-child", ["firstp","sndp"] );
t( "Last Child", "p:last-child", ["sap"] );
t( "Only Child", "a:only-child", ["simon1","anchor1","yahoo","anchor2","liveLink1","liveLink2"] );
@@ -316,6 +316,22 @@ test("pseudo (:) selectors", function() {
t( "Not - multiple", "#form option:not(:contains('Nothing'),#option1b,:selected)", ["option1c", "option1d", "option2b", "option2c", "option3d", "option3e"] );
//t( "Not - complex", "#form option:not([id^='opt']:nth-child(-n+3))", [ "option1a", "option1d", "option2d", "option3d", "option3e"] );
t( "Not - recursive", "#form option:not(:not(:selected))[id^='option3']", [ "option3b", "option3c"] );
+
+ t( ":not() failing interior", "p:not(.foo)", ["firstp","ap","sndp","en","sap","first"] );
+ t( ":not() failing interior", "p:not(div.foo)", ["firstp","ap","sndp","en","sap","first"] );
+ t( ":not() failing interior", "p:not(p.foo)", ["firstp","ap","sndp","en","sap","first"] );
+ t( ":not() failing interior", "p:not(#blargh)", ["firstp","ap","sndp","en","sap","first"] );
+ t( ":not() failing interior", "p:not(div#blargh)", ["firstp","ap","sndp","en","sap","first"] );
+ t( ":not() failing interior", "p:not(p#blargh)", ["firstp","ap","sndp","en","sap","first"] );
+
+ t( ":not Multiple", "p:not(a)", ["firstp","ap","sndp","en","sap","first"] );
+ t( ":not Multiple", "p:not(a, b)", ["firstp","ap","sndp","en","sap","first"] );
+ t( ":not Multiple", "p:not(a, b, div)", ["firstp","ap","sndp","en","sap","first"] );
+ t( ":not Multiple", "p:not(p)", [] );
+ t( ":not Multiple", "p:not(a,p)", [] );
+ t( ":not Multiple", "p:not(p,a)", [] );
+ t( ":not Multiple", "p:not(a,p,b)", [] );
+ t( ":not Multiple", ":input:not(:image,:input,:submit)", [] );
t( "nth Element", "p:nth(1)", ["ap"] );
t( "First Element", "p:first", ["firstp"] );