Pull over tests from Sizzle. Fixes #3729. Fixes #6428.
[jquery.git] / test / unit / selector.js
index d23b4e4..3d83737 100644 (file)
@@ -227,7 +227,7 @@ test("multiple", function() {
 });
 
 test("child and adjacent", function() {
-       expect(31);
+       expect(29);
        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"] );
@@ -251,9 +251,6 @@ test("child and adjacent", function() {
        t( "Element Preceded By", "#siblingfirst ~ em", ["siblingnext"] );
        same( jQuery("#siblingfirst").find("~ em").get(), q("siblingnext"), "Element Preceded By with a context." );
        same( jQuery("#siblingfirst").find("+ em").get(), q("siblingnext"), "Element Directly Preceded By with a context." );
-       var a = jQuery("<div id='foo'></div><p id='bar'></p><p id='bar2'></p>");
-       same( jQuery("~ p", a[0]).get(), [a[1], a[2]], "Detached Element Directly Preceded By with a context." );
-       same( jQuery("+ p", a[0]).get(), [a[1]], "Detached Element Preceded By with a context." );
 
        t( "Verify deep class selector", "div.blah > p > a", [] );
 
@@ -267,7 +264,7 @@ test("child and adjacent", function() {
 });
 
 test("attributes", function() {
-       expect(41);
+       expect(43);
 
        t( "Attribute Exists", "a[title]", ["google"] );
        t( "Attribute Exists", "*[title]", ["google"] );
@@ -333,6 +330,15 @@ test("attributes", function() {
        t("Find escaped attribute value", "input[name=foo\\[baz\\]]", ["attrbad2"]);
 
        attrbad.remove();
+
+       //#6428
+       t("Find escaped attribute value", "#form input[name=foo\\[bar\\]]", ["hidden2"]);
+
+       //#3279
+       var div = document.createElement("div");
+       div.innerHTML = "<div id='foo' xml:test='something'></div>";
+       
+       deepEqual( jQuery( "[xml\\:test]", div ).get(), [ div.firstChild ], "Finding by attribute with escaped characters." );
 });
 
 test("pseudo - child", function() {