diff options
author | gnarf <gnarf@gnarf.net> | 2011-06-14 23:38:36 -0500 |
---|---|---|
committer | gnarf <gnarf@gnarf.net> | 2011-06-14 23:38:36 -0500 |
commit | 9a96af1d59cc6a10b89b6f2489b04871a9c1c7fa (patch) | |
tree | 975ac7651be8809426a343a8c1b480ca1e9c08ac /test/unit/traversing.js | |
parent | b43910a496ccb2b44dcc11b64667e21521aa4994 (diff) | |
download | jquery-9a96af1d59cc6a10b89b6f2489b04871a9c1c7fa.tar.gz jquery-9a96af1d59cc6a10b89b6f2489b04871a9c1c7fa.zip |
Quick improvement to the performace of .index() with no arguments - Adding a unit test for .index() of a node without a parent returns -1
Diffstat (limited to 'test/unit/traversing.js')
-rw-r--r-- | test/unit/traversing.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/unit/traversing.js b/test/unit/traversing.js index 5216ae752..70c142597 100644 --- a/test/unit/traversing.js +++ b/test/unit/traversing.js @@ -99,9 +99,11 @@ test("is(jQuery)", function() { }); test("index()", function() { - expect(1); + expect( 2 ); - equals( jQuery("#text2").index(), 2, "Returns the index of a child amongst its siblings" ) + equal( jQuery("#text2").index(), 2, "Returns the index of a child amongst its siblings" ); + + equal( jQuery("<div/>").index(), -1, "Node without parent returns -1" ); }); test("index(Object|String|undefined)", function() { |