diff options
author | Ariel Flesler <aflesler@gmail.com> | 2008-07-01 02:08:45 +0000 |
---|---|---|
committer | Ariel Flesler <aflesler@gmail.com> | 2008-07-01 02:08:45 +0000 |
commit | 28937ded0ebecd0e48138e57322b299cefcef4a7 (patch) | |
tree | 8a21512099bd71b95868a5b2528cd5441b28b784 /test/unit | |
parent | a23e4361fc0221ca6132e962a5a8b2030bd1c390 (diff) | |
download | jquery-28937ded0ebecd0e48138e57322b299cefcef4a7.tar.gz jquery-28937ded0ebecd0e48138e57322b299cefcef4a7.zip |
test runner: optimizing a test for speed.
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/core.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/test/unit/core.js b/test/unit/core.js index dbf23e7d3..71b124637 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() {
|