X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fselector%2FselectorTest.js;h=939edbe0db67828f093d3bf418a47e90d760cd2a;hb=e95a6cc746f9217fa285a87c2e9c0705babf2824;hp=23f44c30dc660269d72519356a2abace0fc98b3a;hpb=2fac5e7949ec342c450b2e032509eed0e35cf1ff;p=jquery.git diff --git a/src/selector/selectorTest.js b/src/selector/selectorTest.js index 23f44c3..939edbe 100644 --- a/src/selector/selectorTest.js +++ b/src/selector/selectorTest.js @@ -1,7 +1,7 @@ module("selector"); test("element", function() { - expect(8); + expect(9); ok( $("*").size() >= 30, "Select all" ); t( "Element Selector", "div", ["main","foo"] ); t( "Element Selector", "body", ["body"] ); @@ -11,6 +11,8 @@ test("element", function() { ok( $("#length").length, '<input name="length"> cannot be found under IE, see #945' ); ok( $("#lengthtest input").length, '<input name="length"> cannot be found under IE, see #945' ); + + t( "Element Selector with underscore", "foo_bar", ["foobar"] ); }); test("broken", function() { @@ -88,7 +90,7 @@ test("multiple", function() { }); test("child and adjacent", function() { - expect(22); + expect(18); 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"] ); @@ -105,15 +107,11 @@ test("child and adjacent", function() { 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() { @@ -204,4 +202,4 @@ test("basic xpath", function() { $("#foo").each(function() { isSet( $("/p", this).get(), q("sndp", "en", "sap"), "Check XPath context" ); }); -}); \ No newline at end of file +});