aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorDavid Serduke <davidserduke@gmail.com>2007-12-17 16:54:44 +0000
committerDavid Serduke <davidserduke@gmail.com>2007-12-17 16:54:44 +0000
commit90b25efa6c3c3676c5ae1dd782d04726e03a31e8 (patch)
tree23678f8f10047cf4c2927310a1ef298454bc649a /test/unit
parentd7f5a0835bc463d15a4f6210e48110054a050f0b (diff)
downloadjquery-90b25efa6c3c3676c5ae1dd782d04726e03a31e8.tar.gz
jquery-90b25efa6c3c3676c5ae1dd782d04726e03a31e8.zip
Fixed #2062 by adding a check to see if the selector is array-like in .not() before testing it as an array. Otherwise it does a straight comparison during the filter test.
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/core.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/unit/core.js b/test/unit/core.js
index 088726ff7..ea687c8f8 100644
--- a/test/unit/core.js
+++ b/test/unit/core.js
@@ -1058,11 +1058,13 @@ test("filter()", function() {
});
test("not()", function() {
- expect(5);
+ expect(7);
ok( $("#main > p#ap > a").not("#google").length == 2, "not('selector')" );
+ ok( $("#main > p#ap > a").not(document.getElementById("google")).length == 2, "not(DOMElement)" );
isSet( $("p").not(".result").get(), q("firstp", "ap", "sndp", "en", "sap", "first"), "not('.class')" );
isSet( $("p").not("#ap, #sndp, .result").get(), q("firstp", "en", "sap", "first"), "not('selector, selector')" );
isSet( $("p").not($("#ap, #sndp, .result")).get(), q("firstp", "en", "sap", "first"), "not(jQuery)" );
+ ok( $("p").not(document.getElementsByTagName("p")).length == 0, "not(Array-like DOM collection)" );
isSet( $("#form option").not("option.emptyopt:contains('Nothing'),[selected],[value='1']").get(), q("option1c", "option1d", "option2c", "option3d" ), "not('complex selector')");
});