X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fselector.js;h=c4c13601ba84a462659afe1c94db8b33708323ba;hb=048fc4555f8a794239a985c63cff3f76d20d6c61;hp=99cef579fedbecee28fc6222e86473c3b557dd1f;hpb=e25c4a132f9f11cb407605e3ca7d1900ca904077;p=jquery.git diff --git a/test/unit/selector.js b/test/unit/selector.js index 99cef57..c4c1360 100644 --- a/test/unit/selector.js +++ b/test/unit/selector.js @@ -35,10 +35,12 @@ test("element", function() { if ( location.protocol != "file:" ) { test("XML Document Selectors", function() { - expect(5); + expect(7); stop(); jQuery.get("data/with_fries.xml", function(xml) { equals( jQuery("foo_bar", xml).length, 1, "Element Selector with underscore" ); + equals( jQuery(".component", xml).length, 1, "Class selector" ); + equals( jQuery("[class*=component]", xml).length, 1, "Attribute selector for class" ); equals( jQuery("property[name=prop2]", xml).length, 1, "Attribute selector with name" ); equals( jQuery("[name=prop2]", xml).length, 1, "Attribute selector with name" ); equals( jQuery("#seite1", xml).length, 1, "Attribute selector with ID" ); @@ -180,7 +182,7 @@ test("multiple", function() { }); test("child and adjacent", function() { - expect(48); + expect(49); 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"] ); @@ -211,6 +213,7 @@ test("child and adjacent", function() { t( "First Child", "p:first-child", ["firstp","sndp"] ); t( "Nth Child", "p:nth-child(1)", ["firstp","sndp"] ); + t( "Not Nth Child", "p:not(:nth-child(1))", ["ap","en","sap","first"] ); // Verify that the child position isn't being cached improperly jQuery("p:first-child").after("
");