X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fselector%2FselectorTest.js;h=d3004f05be264b088e49830fa33bdbf3351934fa;hb=4e7c9b08a0fb6142755e39cfaae2f8330831008c;hp=918074327756b662abd96777595b69a9eb7e0713;hpb=ae208246fbd1708b72e822b61c9e24d3034d1a05;p=jquery.git diff --git a/src/selector/selectorTest.js b/src/selector/selectorTest.js index 9180743..d3004f0 100644 --- a/src/selector/selectorTest.js +++ b/src/selector/selectorTest.js @@ -85,7 +85,7 @@ test("multiple", function() { }); test("child and adjacent", function() { - expect(14); + expect(22); 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"] ); @@ -99,7 +99,18 @@ test("child and adjacent", function() { t( "Adjacent", "a+a", ["groups"] ); t( "Adjacent", "p + p", ["ap","en","sap"] ); t( "Comma, Child, and Adjacent", "a + a, code > a", ["groups","anchor1","anchor2"] ); + t( "First Child", "p:first-child", ["firstp","sndp"] ); + t( "Nth Child", "p:nth-child(1)", ["firstp","sndp"] ); + t( "First Child, XPath", "p[1]", ["firstp","sndp"] ); + + t( "Last Child", "p:last-child", ["sap"] ); + t( "Last Child, XPath", "p[3]", ["sap"] ); + + t( "Nth-child", "#main form > *:nth-child(2)", ["text2"] ); + t( "Nth-child, XPath", "#main form > *[2]", ["text2"] ); + t( "Nth-child", "#main form > :nth-child(2)", ["text2"] ); + t( "Nth-child, XPath", "#main form > [2]", ["text2"] ); }); test("attributes", function() { @@ -132,7 +143,7 @@ test("attributes", function() { t( ":not() Equals quoted attribute", "select:not([@name='select1'])", ["select2", "select3"]); }); -test("pseudo (:) selctors", function() { +test("pseudo (:) selectors", function() { expect(30); t( "First Child", "p:first-child", ["firstp","sndp"] ); t( "Last Child", "p:last-child", ["sap"] ); @@ -189,3 +200,9 @@ test("basic xpath", function() { isSet( $("/p", this).get(), q("sndp", "en", "sap"), "Check XPath context" ); }); }); + +test('<input name="length"> cannot be found under IE, see #945', function() { + expect(2); + ok( $("#length").length ); + ok( $("#lengthtest input").length ); +});