After discussing it with a number of users I've decided to revert the change to ...
[jquery.git] / test / unit / selector.js
index 4bc1577..5103d58 100644 (file)
@@ -141,7 +141,7 @@ test("multiple", function() {
 });
 
 test("child and adjacent", function() {
-       expect(44);
+       expect(45);
        t( "Child", "p > a", ["simon1","google","groups","mark","yahoo","simon"] );
        t( "Child", "p> a", ["simon1","google","groups","mark","yahoo","simon"] );
        t( "Child", "p >a", ["simon1","google","groups","mark","yahoo","simon"] );
@@ -169,6 +169,14 @@ test("child and adjacent", function() {
        
        t( "First Child", "p:first-child", ["firstp","sndp"] );
        t( "Nth Child", "p:nth-child(1)", ["firstp","sndp"] );
+
+       // Verify that the child position isn't being cached improperly
+       jQuery("p:first-child").after("<div></div>");
+       jQuery("p:first-child").before("<div></div>").next().remove();
+
+       t( "First Child", "p:first-child", [] );
+
+       reset();
        
        t( "Last Child", "p:last-child", ["sap"] );
        t( "Last Child", "a:last-child", ["simon1","anchor1","mark","yahoo","anchor2","simon"] );
@@ -197,7 +205,7 @@ test("child and adjacent", function() {
 });
 
 test("attributes", function() {
-       expect(34);
+       expect(35);
        t( "Attribute Exists", "a[title]", ["google"] );
        t( "Attribute Exists", "*[title]", ["google"] );
        t( "Attribute Exists", "[title]", ["google"] );
@@ -239,6 +247,7 @@ test("attributes", function() {
        t( "Attribute Begins With", "a[href ^= 'http://www']", ["google","yahoo"] );
        t( "Attribute Ends With", "a[href $= 'org/']", ["mark"] );
        t( "Attribute Contains", "a[href *= 'google']", ["google","groups"] );
+       t( "Attribute Is Not Equal", "#ap a[hreflang!='en']", ["google","groups","anchor1"] );
        
        t("Select options via :selected", "#select1 option:selected", ["option1a"] );
        t("Select options via :selected", "#select2 option:selected", ["option2d"] );