aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2007-03-24 21:55:03 +0000
committerJohn Resig <jeresig@gmail.com>2007-03-24 21:55:03 +0000
commitec2b688920cf38f5bb2487b8a1897f7eb7557248 (patch)
tree2e37bf471217f3ce20d7799e5f239278e89afc69 /build
parent1b9f4d3d2e1bc2dfd7572da77159fa01f9ab5d6e (diff)
downloadjquery-ec2b688920cf38f5bb2487b8a1897f7eb7557248.tar.gz
jquery-ec2b688920cf38f5bb2487b8a1897f7eb7557248.zip
Merged my speed improvements into the jQuery core (is actually 200b smaller now!). Additionally, added in some better reporting to the test suite, and fixed a bug with how selector tests were performmed.
Diffstat (limited to 'build')
-rw-r--r--build/test/data/testrunner.js22
1 files changed, 19 insertions, 3 deletions
diff --git a/build/test/data/testrunner.js b/build/test/data/testrunner.js
index 78395aadb..72238e31b 100644
--- a/build/test/data/testrunner.js
+++ b/build/test/data/testrunner.js
@@ -172,17 +172,33 @@ function ok(a, msg) {
function isSet(a, b, msg) {
var ret = true;
if ( a && b && a.length == b.length ) {
- for ( var i in a )
+ for ( var i = 0; i < a.length; i++ )
if ( a[i] != b[i] )
ret = false;
} else
ret = false;
if ( !ret )
- _config.Test.push( [ ret, msg + " expected: " + b + " result: " + a ] );
+ _config.Test.push( [ ret, msg + " expected: " + serialArray(b) + " result: " + serialArray(a) ] );
else
_config.Test.push( [ ret, msg ] );
}
+function serialArray( a ) {
+ var r = [];
+ for ( var i = 0; i < a.length; i++ ) {
+ var str = a[i].nodeName;
+ if ( str ) {
+ str = str.toLowerCase();
+ if ( a[i].id )
+ str += "#" + a[i].id;
+ } else
+ str = a[i];
+ r.push( str );
+ }
+
+ return "[ " + r.join(", ") + " ]"
+}
+
/**
* Returns an array of elements with the given IDs, eg.
* @example q("main", "foo", "bar")
@@ -201,7 +217,7 @@ function q() {
* @result returns true if "//[a]" return two elements with the IDs 'foo' and 'baar'
*/
function t(a,b,c) {
- var f = jQuery.find(b);
+ var f = jQuery(b);
var s = "";
for ( var i = 0; i < f.length; i++ )
s += (s && ",") + '"' + f[i].id + '"';