Skip to content
Permalink
Browse files

test runner: optimizing a test for speed.

  • Loading branch information
flesler committed Jul 1, 2008
1 parent a23e436 commit 28937ded0ebecd0e48138e57322b299cefcef4a7
Showing with 9 additions and 6 deletions.
  1. +9 −6 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() {

0 comments on commit 28937de

Please sign in to comment.
You can’t perform that action at this time.