X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fcore.js;h=71b124637f7b4737f7b341dbf9027a79e49990df;hb=6eb2bfe6aefaeff522a9d3a8ac9511e15932bfcf;hp=dda7929231e5a3cdcce3b14ec204e2e36f83bbe0;hpb=21d669135d3fe735d116a8b9a457b961ef684b0d;p=jquery.git diff --git a/test/unit/core.js b/test/unit/core.js index dda7929..71b1246 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -1575,13 +1575,18 @@ test("empty()", function() { }); test("slice()", function() { - expect(5); - 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)" ); + expect(6); + + 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( $links.eq('2'), q("anchor1"), "eq('2')" ); }); test("map()", function() {