X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fselector.js;h=4e6feaff73d76af0004a76e3acea5031a7bfcc00;hb=626961c4a54cccaae0ecef81f2058cd0888611cc;hp=4bc15773fa5d35276ef5bbd8f79e52590063f940;hpb=aa7616cf9aac1692a483165144a42cde9a3169e0;p=jquery.git diff --git a/test/unit/selector.js b/test/unit/selector.js index 4bc1577..4e6feaf 100644 --- a/test/unit/selector.js +++ b/test/unit/selector.js @@ -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("
"); + jQuery("p:first-child").before("
").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"] );