X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fcore.js;h=71b124637f7b4737f7b341dbf9027a79e49990df;hb=cf78e396db1b986360c32fb0ca071a0fb90da064;hp=dbf23e7d3f9f036870945dc81d3cae0b692bcd33;hpb=a23e4361fc0221ca6132e962a5a8b2030bd1c390;p=jquery.git diff --git a/test/unit/core.js b/test/unit/core.js index dbf23e7..71b1246 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -1576,14 +1576,17 @@ test("empty()", function() { test("slice()", function() { expect(6); - isSet( jQuery("#ap a").slice(1,2), q("groups"), "slice(1,2)" ); - isSet( jQuery("#ap a").slice(1), q("groups", "anchor1", "mark"), "slice(1)" ); - isSet( jQuery("#ap a").slice(0,3), q("google", "groups", "anchor1"), "slice(0,3)" ); - isSet( jQuery("#ap a").slice(-1), q("mark"), "slice(-1)" ); + + var $links = jQuery("#ap a"); + + isSet( $links.slice(1,2), q("groups"), "slice(1,2)" ); + isSet( $links.slice(1), q("groups", "anchor1", "mark"), "slice(1)" ); + isSet( $links.slice(0,3), q("google", "groups", "anchor1"), "slice(0,3)" ); + isSet( $links.slice(-1), q("mark"), "slice(-1)" ); - isSet( jQuery("#ap a").eq(1), q("groups"), "eq(1)" ); + isSet( $links.eq(1), q("groups"), "eq(1)" ); - isSet( jQuery("#ap a").eq('1'), q("groups"), "eq('1')" ); + isSet( $links.eq('2'), q("anchor1"), "eq('2')" ); }); test("map()", function() {