<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -7,77 +7,300 @@
  * Dual licensed under the MIT (MIT-LICENSE.txt)
  * and GPL (GPL-LICENSE.txt) licenses.
  *
- * $Id: testrunner.js 5827 2008-08-13 17:14:48Z joern.zaefferer $
+ * $Id: testrunner.js 6133 2009-01-19 22:38:58Z jeresig $
  */
 
-var _config = {
-	fixture: null,
-	Test: [],
+(function($) {
+
+// Tests for equality any JavaScript type and structure without unexpected results.
+// Discussions and reference: http://philrathe.com/articles/equiv
+// Test suites: http://philrathe.com/tests/equiv
+// Author: Philippe Rath&#233; &lt;prathe@gmail.com&gt;
+var equiv = function () {
+
+    var innerEquiv; // the real equiv function
+    var callers = []; // stack to decide between skip/abort functions
+
+    // Determine what is o.
+    function hoozit(o) {
+        if (typeof o === &quot;string&quot;) {
+            return &quot;string&quot;;
+
+        } else if (typeof o === &quot;boolean&quot;) {
+            return &quot;boolean&quot;;
+
+        } else if (typeof o === &quot;number&quot;) {
+
+            if (isNaN(o)) {
+                return &quot;nan&quot;;
+            } else {
+                return &quot;number&quot;;
+            }
+
+        } else if (typeof o === &quot;undefined&quot;) {
+            return &quot;undefined&quot;;
+
+        // consider: typeof null === object
+        } else if (o === null) {
+            return &quot;null&quot;;
+
+        // consider: typeof [] === object
+        } else if (o instanceof Array) {
+            return &quot;array&quot;;
+        
+        // consider: typeof new Date() === object
+        } else if (o instanceof Date) {
+            return &quot;date&quot;;
+
+        // consider: /./ instanceof Object;
+        //           /./ instanceof RegExp;
+        //          typeof /./ === &quot;function&quot;; // =&gt; false in IE and Opera,
+        //                                          true in FF and Safari
+        } else if (o instanceof RegExp) {
+            return &quot;regexp&quot;;
+
+        } else if (typeof o === &quot;object&quot;) {
+            return &quot;object&quot;;
+
+        } else if (o instanceof Function) {
+            return &quot;function&quot;;
+        }
+    }
+
+    // Call the o related callback with the given arguments.
+    function bindCallbacks(o, callbacks, args) {
+        var prop = hoozit(o);
+        if (prop) {
+            if (hoozit(callbacks[prop]) === &quot;function&quot;) {
+                return callbacks[prop].apply(callbacks, args);
+            } else {
+                return callbacks[prop]; // or undefined
+            }
+        }
+    }
+
+    var callbacks = function () {
+
+        // for string, boolean, number and null
+        function useStrictEquality(b, a) {
+            return a === b;
+        }
+
+        return {
+            &quot;string&quot;: useStrictEquality,
+            &quot;boolean&quot;: useStrictEquality,
+            &quot;number&quot;: useStrictEquality,
+            &quot;null&quot;: useStrictEquality,
+            &quot;undefined&quot;: useStrictEquality,
+
+            &quot;nan&quot;: function (b) {
+                return isNaN(b);
+            },
+
+            &quot;date&quot;: function (b, a) {
+                return hoozit(b) === &quot;date&quot; &amp;&amp; a.valueOf() === b.valueOf();
+            },
+
+            &quot;regexp&quot;: function (b, a) {
+                return hoozit(b) === &quot;regexp&quot; &amp;&amp;
+                    a.source === b.source &amp;&amp; // the regex itself
+                    a.global === b.global &amp;&amp; // and its modifers (gmi) ...
+                    a.ignoreCase === b.ignoreCase &amp;&amp;
+                    a.multiline === b.multiline;
+            },
+
+            // - skip when the property is a method of an instance (OOP)
+            // - abort otherwise,
+            //   initial === would have catch identical references anyway
+            &quot;function&quot;: function () {
+                var caller = callers[callers.length - 1];
+                return caller !== Object &amp;&amp;
+                        typeof caller !== &quot;undefined&quot;;
+            },
+
+            &quot;array&quot;: function (b, a) {
+                var i;
+                var len;
+
+                // b could be an object literal here
+                if ( ! (hoozit(b) === &quot;array&quot;)) {
+                    return false;
+                }
+
+                len = a.length;
+                if (len !== b.length) { // safe and faster
+                    return false;
+                }
+                for (i = 0; i &lt; len; i++) {
+                    if( ! innerEquiv(a[i], b[i])) {
+                        return false;
+                    }
+                }
+                return true;
+            },
+
+            &quot;object&quot;: function (b, a) {
+                var i;
+                var eq = true; // unless we can proove it
+                var aProperties = [], bProperties = []; // collection of strings
+
+                // comparing constructors is more strict than using instanceof
+                if ( a.constructor !== b.constructor) {
+                    return false;
+                }
+
+                // stack constructor before traversing properties
+                callers.push(a.constructor);
+
+                for (i in a) { // be strict: don't ensures hasOwnProperty and go deep
+
+                    aProperties.push(i); // collect a's properties
+
+                    if ( ! innerEquiv(a[i], b[i])) {
+                        eq = false;
+                    }
+                }
+
+                callers.pop(); // unstack, we are done
+
+                for (i in b) {
+                    bProperties.push(i); // collect b's properties
+                }
+
+                // Ensures identical properties name
+                return eq &amp;&amp; innerEquiv(aProperties.sort(), bProperties.sort());
+            }
+        };
+    }();
+
+    innerEquiv = function () { // can take multiple arguments
+        var args = Array.prototype.slice.apply(arguments);
+        if (args.length &lt; 2) {
+            return true; // end transition
+        }
+
+        return (function (a, b) {
+            if (a === b) {
+                return true; // catch the most you can
+
+            } else if (typeof a !== typeof b || a === null || b === null || typeof a === &quot;undefined&quot; || typeof b === &quot;undefined&quot;) {
+                return false; // don't lose time with error prone cases
+
+            } else {
+                return bindCallbacks(a, callbacks, [b, a]);
+            }
+
+        // apply transition with (1..n) arguments
+        })(args[0], args[1]) &amp;&amp; arguments.callee.apply(this, args.splice(1, args.length -1));
+    };
+
+    return innerEquiv;
+}(); // equiv
+
+var GETParams = $.map( location.search.slice(1).split('&amp;'), decodeURIComponent ),
+	ngindex = $.inArray(&quot;noglobals&quot;, GETParams),
+	noglobals = ngindex !== -1;
+
+if( noglobals )
+	GETParams.splice( ngindex, 1 );
+	
+var config = {
 	stats: {
 		all: 0,
 		bad: 0
 	},
 	queue: [],
+	// block until document ready
 	blocking: true,
-	timeout: null,
-	expected: null,
-	currentModule: null,
-	asyncTimeout: 2 // seconds for async timeout
+	//restrict modules/tests by get parameters
+	filters: GETParams,
+	isLocal: !!(window.location.protocol == 'file:')
 };
 
-_config.filters = location.search.length &gt; 1 &amp;&amp; //restrict modules/tests by get parameters
-		jQuery.map( location.search.slice(1).split('&amp;'), decodeURIComponent );
-
-var isLocal = !!(window.location.protocol == 'file:');
+// public API as global methods
+$.extend(window, {
+	test: test,
+	module: module,
+	expect: expect,
+	ok: ok,
+	equals: equals,
+	start: start,
+	stop: stop,
+	reset: reset,
+	isLocal: config.isLocal,
+	same: function(a, b, message) {
+		push(equiv(a, b), a, b, message);
+	},
+	QUnit: {
+		equiv: equiv
+	},
+	// legacy methods below
+	isSet: isSet,
+	isObj: isObj,
+	compare: function() {
+		throw &quot;compare is deprecated - use same() instead&quot;;
+	},
+	compare2: function() {
+		throw &quot;compare2 is deprecated - use same() instead&quot;;
+	},
+	serialArray: function() {
+		throw &quot;serialArray is deprecated - use jsDump.parse() instead&quot;;
+	},
+	q: q,
+	t: t,
+	url: url,
+	triggerEvent: triggerEvent
+});
 
-jQuery(function() {
-	jQuery('#userAgent').html(navigator.userAgent);
+$(window).load(function() {
+	$('#userAgent').html(navigator.userAgent);
+	var head = $('&lt;div class=&quot;testrunner-toolbar&quot;&gt;&lt;label for=&quot;filter&quot;&gt;Hide passed tests&lt;/label&gt;&lt;/div&gt;').insertAfter(&quot;#userAgent&quot;);
+	$('&lt;input type=&quot;checkbox&quot; id=&quot;filter&quot; /&gt;').attr(&quot;disabled&quot;, true).prependTo(head).click(function() {
+		$('li.pass')[this.checked ? 'hide' : 'show']();
+	});
 	runTest();	
 });
 
 function synchronize(callback) {
-	_config.queue[_config.queue.length] = callback;
-	if(!_config.blocking) {
+	config.queue.push(callback);
+	if(!config.blocking) {
 		process();
 	}
 }
 
 function process() {
-	while(_config.queue.length &amp;&amp; !_config.blocking) {
-		var call = _config.queue[0];
-		_config.queue = _config.queue.slice(1);
-		call();
+	while(config.queue.length &amp;&amp; !config.blocking) {
+		config.queue.shift()();
 	}
 }
 
-function stop(allowFailure) {
-	_config.blocking = true;
-	var handler = allowFailure ? start : function() {
-		ok( false, &quot;Test timed out&quot; );
-		start();
-	};
-	// Disabled, caused too many random errors
-	//_config.timeout = setTimeout(handler, _config.asyncTimeout * 1000);
+function stop(timeout) {
+	config.blocking = true;
+	if (timeout)
+		config.timeout = setTimeout(function() {
+			ok( false, &quot;Test timed out&quot; );
+			start();
+		}, timeout);
 }
 function start() {
 	// A slight delay, to avoid any current callbacks
-	setTimeout(function(){
-		if(_config.timeout)
-			clearTimeout(_config.timeout);
-		_config.blocking = false;
+	setTimeout(function() {
+		if(config.timeout)
+			clearTimeout(config.timeout);
+		config.blocking = false;
 		process();
 	}, 13);
 }
 
 function validTest( name ) {
-	var filters = _config.filters;
-	if( !filters )
-		return true;
-
-	var i = filters.length,
+	var i = config.filters.length,
 		run = false;
+
+	if( !i )
+		return true;
+	
 	while( i-- ){
-		var filter = filters[i],
+		var filter = config.filters[i],
 			not = filter.charAt(0) == '!';
 		if( not ) 
 			filter = filter.slice(1);
@@ -90,29 +313,71 @@ function validTest( name ) {
 }
 
 function runTest() {
-	_config.blocking = false;
+	config.blocking = false;
 	var started = +new Date;
-	_config.fixture = document.getElementById('main').innerHTML;
-	_config.ajaxSettings = jQuery.ajaxSettings;
+	config.fixture = document.getElementById('main').innerHTML;
+	config.ajaxSettings = $.ajaxSettings;
 	synchronize(function() {
-		jQuery('&lt;p id=&quot;testresult&quot; class=&quot;result&quot;&gt;').html(['Tests completed in ',
+		$('&lt;p id=&quot;testresult&quot; class=&quot;result&quot;/&gt;').html(['Tests completed in ',
 			+new Date - started, ' milliseconds.&lt;br/&gt;',
-			'&lt;span class=&quot;bad&quot;&gt;', _config.stats.bad, '&lt;/span&gt; tests of &lt;span class=&quot;all&quot;&gt;', _config.stats.all, '&lt;/span&gt; failed.&lt;/p&gt;']
+			'&lt;span class=&quot;bad&quot;&gt;', config.stats.bad, '&lt;/span&gt; tests of &lt;span class=&quot;all&quot;&gt;', config.stats.all, '&lt;/span&gt; failed.']
 			.join(''))
 			.appendTo(&quot;body&quot;);
-		jQuery(&quot;#banner&quot;).addClass(_config.stats.bad ? &quot;fail&quot; : &quot;pass&quot;);
+		$(&quot;#banner&quot;).addClass(config.stats.bad ? &quot;fail&quot; : &quot;pass&quot;);
 	});
 }
 
-function test(name, callback, nowait) {
-	if(_config.currentModule)
-		name = _config.currentModule + &quot; module: &quot; + name;
-		
+var pollution;
+
+function saveGlobal(){
+	pollution = [ ];
+	
+	if( noglobals )
+		for( var key in window )
+			pollution.push(key);
+}
+function checkPollution( name ){
+	var old = pollution;
+	saveGlobal();
+	
+	if( pollution.length &gt; old.length ){
+		ok( false, &quot;Introduced global variable(s): &quot; + diff(old, pollution).join(&quot;, &quot;) );
+		config.expected++;
+	}
+}
+
+function diff( clean, dirty ){
+	return $.grep( dirty, function(name){
+		return $.inArray( name, clean ) == -1;
+	});
+}
+
+function test(name, callback) {
+	if(config.currentModule)
+		name = config.currentModule + &quot; module: &quot; + name;
+	var lifecycle = $.extend({
+		setup: function() {},
+		teardown: function() {}
+	}, config.moduleLifecycle);
+	
 	if ( !validTest(name) )
 		return;
-		
+	
+	synchronize(function() {
+		config.assertions = [];
+		config.expected = null;
+		try {
+			if( !pollution )
+				saveGlobal();
+			lifecycle.setup();
+		} catch(e) {
+			config.assertions.push( {
+				result: false,
+				message: &quot;Setup failed on &quot; + name + &quot;: &quot; + e.message
+			});
+		}
+	})
 	synchronize(function() {
-		_config.Test = [];
 		try {
 			callback();
 		} catch(e) {
@@ -121,11 +386,27 @@ function test(name, callback, nowait) {
 				console.error(e);
 				console.warn(callback.toString());
 			}
-			_config.Test.push( [ false, &quot;Died on test #&quot; + (_config.Test.length+1) + &quot;: &quot; + e.message ] );
+			config.assertions.push( {
+				result: false,
+				message: &quot;Died on test #&quot; + (config.assertions.length + 1) + &quot;: &quot; + e.message
+			});
+			// else next test will carry the responsibility
+			saveGlobal();
 		}
 	});
 	synchronize(function() {
 		try {
+			checkPollution();
+			lifecycle.teardown();
+		} catch(e) {
+			config.assertions.push( {
+				result: false,
+				message: &quot;Teardown failed on &quot; + name + &quot;: &quot; + e.message
+			});
+		}
+	})
+	synchronize(function() {
+		try {
 			reset();
 		} catch(e) {
 			if( typeof console != &quot;undefined&quot; &amp;&amp; console.error &amp;&amp; console.warn ) {
@@ -135,91 +416,97 @@ function test(name, callback, nowait) {
 			}
 		}
 		
-		// don't output pause tests
-		if(nowait) return;
-		
-		if(_config.expected &amp;&amp; _config.expected != _config.Test.length) {
-			_config.Test.push( [ false, &quot;Expected &quot; + _config.expected + &quot; assertions, but &quot; + _config.Test.length + &quot; were run&quot; ] );
+		if(config.expected &amp;&amp; config.expected != config.assertions.length) {
+			config.assertions.push({
+				result: false,
+				message: &quot;Expected &quot; + config.expected + &quot; assertions, but &quot; + config.assertions.length + &quot; were run&quot;
+			});
 		}
-		_config.expected = null;
 		
 		var good = 0, bad = 0;
-		var ol = document.createElement(&quot;ol&quot;);
-		ol.style.display = &quot;none&quot;;
-		var li = &quot;&quot;, state = &quot;pass&quot;;
-		for ( var i = 0; i &lt; _config.Test.length; i++ ) {
-			var li = document.createElement(&quot;li&quot;);
-			li.className = _config.Test[i][0] ? &quot;pass&quot; : &quot;fail&quot;;
-			li.appendChild( document.createTextNode(_config.Test[i][1]) );
-			ol.appendChild( li );
-			
-			_config.stats.all++;
-			if ( !_config.Test[i][0] ) {
-				state = &quot;fail&quot;;
-				bad++;
-				_config.stats.bad++;
-			} else good++;
+		var ol  = $(&quot;&lt;ol/&gt;&quot;).hide();
+		config.stats.all += config.assertions.length;
+		for ( var i = 0; i &lt; config.assertions.length; i++ ) {
+			var assertion = config.assertions[i];
+			$(&quot;&lt;li/&gt;&quot;).addClass(assertion.result ? &quot;pass&quot; : &quot;fail&quot;).text(assertion.message || &quot;(no message)&quot;).appendTo(ol);
+			assertion.result ? good++ : bad++;
 		}
+		config.stats.bad += bad;
 	
-		var li = document.createElement(&quot;li&quot;);
-		li.className = state;
-	
-		var b = document.createElement(&quot;strong&quot;);
-		b.innerHTML = name + &quot; &lt;b style='color:black;'&gt;(&lt;b class='fail'&gt;&quot; + bad + &quot;&lt;/b&gt;, &lt;b class='pass'&gt;&quot; + good + &quot;&lt;/b&gt;, &quot; + _config.Test.length + &quot;)&lt;/b&gt;&quot;;
-		b.onclick = function(){
-			var n = this.nextSibling;
-			if ( jQuery.css( n, &quot;display&quot; ) == &quot;none&quot; )
-				n.style.display = &quot;block&quot;;
-			else
-				n.style.display = &quot;none&quot;;
-		};
-		jQuery(b).dblclick(function(event) {
-			var target = jQuery(event.target).filter(&quot;strong&quot;).clone();
+		var b = $(&quot;&lt;strong/&gt;&quot;).html(name + &quot; &lt;b style='color:black;'&gt;(&lt;b class='fail'&gt;&quot; + bad + &quot;&lt;/b&gt;, &lt;b class='pass'&gt;&quot; + good + &quot;&lt;/b&gt;, &quot; + config.assertions.length + &quot;)&lt;/b&gt;&quot;)
+		.click(function(){
+			$(this).next().toggle();
+		})
+		.dblclick(function(event) {
+			var target = $(event.target).filter(&quot;strong&quot;).clone();
 			if ( target.length ) {
 				target.children().remove();
-				location.href = location.href.match(/^(.+?)(\?.*)?$/)[1] + &quot;?&quot; + encodeURIComponent(jQuery.trim(target.text()));
+				location.href = location.href.match(/^(.+?)(\?.*)?$/)[1] + &quot;?&quot; + encodeURIComponent($.trim(target.text()));
 			}
 		});
-		li.appendChild( b );
-		li.appendChild( ol );
+		
+		$(&quot;&lt;li/&gt;&quot;).addClass(bad ? &quot;fail&quot; : &quot;pass&quot;).append(b).append(ol).appendTo(&quot;#tests&quot;);
 	
-		document.getElementById(&quot;tests&quot;).appendChild( li );		
+		if(bad) {
+			$(&quot;#filter&quot;).attr(&quot;disabled&quot;, null);
+		}
 	});
 }
 
 // call on start of module test to prepend name to all tests
-function module(moduleName) {
-	_config.currentModule = moduleName;
+function module(name, lifecycle) {
+	config.currentModule = name;
+	config.moduleLifecycle = lifecycle;
 }
 
 /**
  * Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through.
  */
 function expect(asserts) {
-	_config.expected = asserts;
+	config.expected = asserts;
 }
 
 /**
  * Resets the test setup. Useful for tests that modify the DOM.
  */
 function reset() {
-	jQuery(&quot;#main&quot;).html( _config.fixture );
-	jQuery.event.global = {};
-	jQuery.ajaxSettings = jQuery.extend({}, _config.ajaxSettings);
+	$(&quot;#main&quot;).html( config.fixture );
+	$.event.global = {};
+	$.ajaxSettings = $.extend({}, config.ajaxSettings);
 }
 
 /**
  * Asserts true.
- * @example ok( jQuery(&quot;a&quot;).size() &gt; 5, &quot;There must be at least 5 anchors&quot; );
+ * @example ok( $(&quot;a&quot;).size() &gt; 5, &quot;There must be at least 5 anchors&quot; );
  */
 function ok(a, msg) {
-	_config.Test.push( [ !!a, msg ] );
+	config.assertions.push({
+		result: !!a,
+		message: msg
+	});
 }
 
 /**
  * Asserts that two arrays are the same
  */
 function isSet(a, b, msg) {
+	function serialArray( a ) {
+		var r = [];
+		
+		if ( a &amp;&amp; a.length )
+	        for ( var i = 0; i &lt; a.length; i++ ) {
+	            var str = a[i].nodeName;
+	            if ( str ) {
+	                str = str.toLowerCase();
+	                if ( a[i].id )
+	                    str += &quot;#&quot; + a[i].id;
+	            } else
+	                str = a[i];
+	            r.push( str );
+	        }
+	
+		return &quot;[ &quot; + r.join(&quot;, &quot;) + &quot; ]&quot;;
+	}
 	var ret = true;
 	if ( a &amp;&amp; b &amp;&amp; a.length != undefined &amp;&amp; a.length == b.length ) {
 		for ( var i = 0; i &lt; a.length; i++ )
@@ -227,10 +514,10 @@ function isSet(a, b, msg) {
 				ret = false;
 	} else
 		ret = false;
-	if ( !ret )
-		_config.Test.push( [ ret, msg + &quot; expected: &quot; + serialArray(b) + &quot; result: &quot; + serialArray(a) ] );
-	else 
-		_config.Test.push( [ ret, msg ] );
+	config.assertions.push({
+		result: ret,
+		message: !ret ? (msg + &quot; expected: &quot; + serialArray(b) + &quot; result: &quot; + serialArray(a)) : msg
+	});
 }
 
 /**
@@ -250,91 +537,10 @@ function isObj(a, b, msg) {
 	} else
 		ret = false;
 
-    _config.Test.push( [ ret, msg ] );
-}
-
-function serialArray( a ) {
-	var r = [];
-	
-	if ( a &amp;&amp; a.length )
-        for ( var i = 0; i &lt; a.length; i++ ) {
-            var str = a[i].nodeName;
-            if ( str ) {
-                str = str.toLowerCase();
-                if ( a[i].id )
-                    str += &quot;#&quot; + a[i].id;
-            } else
-                str = a[i];
-            r.push( str );
-        }
-
-	return &quot;[ &quot; + r.join(&quot;, &quot;) + &quot; ]&quot;;
-}
-
-function flatMap(a, block) {
-	var result = [];
-	$.each(a, function() {
-		var x = block.apply(this, arguments);
-		if (x !== false)
-			result.push(x);
-	})
-	return result;
-}
-
-function serialObject( a ) {
-	return &quot;{ &quot; + flatMap(a, function(key, value) {
-		return key + &quot;: &quot; + value;
-	}).join(&quot;, &quot;) + &quot; }&quot;;
-}
-
-function compare(a, b, msg) {
-	var ret = true;
-	if ( a &amp;&amp; b &amp;&amp; a.length != undefined &amp;&amp; a.length == b.length ) {
-		for ( var i = 0; i &lt; a.length; i++ )
-			for(var key in a[i]) {
-				if (a[i][key].constructor == Array) {
-					for (var arrayKey in a[i][key]) {
-						if (a[i][key][arrayKey] != b[i][key][arrayKey]) {
-							ret = false;
-						}
-					}
-				} else if (a[i][key] != b[i][key]) {
-					ret = false
-				}
-			}
-	} else
-		ret = false;
-	ok( ret, msg + &quot; expected: &quot; + serialArray(b) + &quot; result: &quot; + serialArray(a) );
-}
-
-function compare2(a, b, msg) {
-	var ret = true;
-	if ( a &amp;&amp; b ) {
-		for(var key in a) {
-			if (a[key].constructor == Array) {
-				for (var arrayKey in a[key]) {
-					if (a[key][arrayKey] != b[key][arrayKey]) {
-						ret = false;
-					}
-				}
-			} else if (a[key] != b[key]) {
-				ret = false
-			}
-		}
-		for(key in b) {
-			if (b[key].constructor == Array) {
-				for (var arrayKey in b[key]) {
-					if (a[key][arrayKey] != b[key][arrayKey]) {
-						ret = false;
-					}
-				}
-			} else if (a[key] != b[key]) {
-				ret = false
-			}
-		}
-	} else
-		ret = false;
-	ok( ret, msg + &quot; expected: &quot; + serialObject(b) + &quot; result: &quot; + serialObject(a) );
+    config.assertions.push({
+		result: ret,
+		message: msg
+	});
 }
 
 /**
@@ -355,7 +561,7 @@ function q() {
  * @result returns true if &quot;//[a]&quot; return two elements with the IDs 'foo' and 'baar'
  */
 function t(a,b,c) {
-	var f = jQuery(b);
+	var f = $(b);
 	var s = &quot;&quot;;
 	for ( var i = 0; i &lt; f.length; i++ )
 		s += (s &amp;&amp; &quot;,&quot;) + '&quot;' + f[i].id + '&quot;';
@@ -388,9 +594,15 @@ function url(value) {
  * @param String message (optional)
  */
 function equals(actual, expected, message) {
-	var result = expected == actual;
+	push(expected == actual, actual, expected, message);
+}
+
+function push(result, actual, expected, message) {
 	message = message || (result ? &quot;okay&quot; : &quot;failed&quot;);
-	_config.Test.push( [ result, result ? message + &quot;: &quot; + expected : message + &quot; expected: &quot; + expected + &quot; actual: &quot; + actual ] );
+	config.assertions.push({
+		result: result,
+		message: result ? message + &quot;: &quot; + expected : message + &quot;, expected: &quot; + jsDump.parse(expected) + &quot; result: &quot; + jsDump.parse(actual)
+	});
 }
 
 /**
@@ -402,12 +614,177 @@ function equals(actual, expected, message) {
  * @param String type
  */
 function triggerEvent( elem, type, event ) {
-	if ( jQuery.browser.mozilla || jQuery.browser.opera ) {
+	if ( $.browser.mozilla || $.browser.opera ) {
 		event = document.createEvent(&quot;MouseEvents&quot;);
 		event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView,
 			0, 0, 0, 0, 0, false, false, false, false, 0, null);
 		elem.dispatchEvent( event );
-	} else if ( jQuery.browser.msie ) {
+	} else if ( $.browser.msie ) {
 		elem.fireEvent(&quot;on&quot;+type);
 	}
 }
+
+})(jQuery);
+
+/**
+ * jsDump
+ * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
+ * Licensed under BSD (http://www.opensource.org/licenses/bsd-license.php)
+ * Date: 5/15/2008
+ * @projectDescription Advanced and extensible data dumping for Javascript.
+ * @version 1.0.0
+ * @author Ariel Flesler
+ * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html}
+ */
+(function(){
+	function quote( str ){
+		return '&quot;' + str.toString().replace(/&quot;/g, '\\&quot;') + '&quot;';
+	};
+	function literal( o ){
+		return o + '';	
+	};
+	function join( pre, arr, post ){
+		var s = jsDump.separator(),
+			base = jsDump.indent();
+			inner = jsDump.indent(1);
+		if( arr.join )
+			arr = arr.join( ',' + s + inner );
+		if( !arr )
+			return pre + post;
+		return [ pre, inner + arr, base + post ].join(s);
+	};
+	function array( arr ){
+		var i = arr.length,	ret = Array(i);					
+		this.up();
+		while( i-- )
+			ret[i] = this.parse( arr[i] );				
+		this.down();
+		return join( '[', ret, ']' );
+	};
+	
+	var reName = /^function (\w+)/;
+	
+	var jsDump = window.jsDump = {
+		parse:function( obj, type ){//type is used mostly internally, you can fix a (custom)type in advance
+			var	parser = this.parsers[ type || this.typeOf(obj) ];
+			type = typeof parser;			
+			
+			return type == 'function' ? parser.call( this, obj ) :
+				   type == 'string' ? parser :
+				   this.parsers.error;
+		},
+		typeOf:function( obj ){
+			var type = typeof obj,
+				f = 'function';//we'll use it 3 times, save it
+			return type != 'object' &amp;&amp; type != f ? type :
+				!obj ? 'null' :
+				obj.exec ? 'regexp' :// some browsers (FF) consider regexps functions
+				obj.getHours ? 'date' :
+				obj.scrollBy ?  'window' :
+				obj.nodeName == '#document' ? 'document' :
+				obj.nodeName ? 'node' :
+				obj.item ? 'nodelist' : // Safari reports nodelists as functions
+				obj.callee ? 'arguments' :
+				obj.call || obj.constructor != Array &amp;&amp; //an array would also fall on this hack
+					(obj+'').indexOf(f) != -1 ? f : //IE reports functions like alert, as objects
+				'length' in obj ? 'array' :
+				type;
+		},
+		separator:function(){
+			return this.multiline ?	this.HTML ? '&lt;br /&gt;' : '\n' : this.HTML ? '&amp;nbsp;' : ' ';
+		},
+		indent:function( extra ){// extra can be a number, shortcut for increasing-calling-decreasing
+			if( !this.multiline )
+				return '';
+			var chr = this.indentChar;
+			if( this.HTML )
+				chr = chr.replace(/\t/g,'   ').replace(/ /g,'&amp;nbsp;');
+			return Array( this._depth_ + (extra||0) ).join(chr);
+		},
+		up:function( a ){
+			this._depth_ += a || 1;
+		},
+		down:function( a ){
+			this._depth_ -= a || 1;
+		},
+		setParser:function( name, parser ){
+			this.parsers[name] = parser;
+		},
+		// The next 3 are exposed so you can use them
+		quote:quote, 
+		literal:literal,
+		join:join,
+		//
+		_depth_: 1,
+		// This is the list of parsers, to modify them, use jsDump.setParser
+		parsers:{
+			window: '[Window]',
+			document: '[Document]',
+			error:'[ERROR]', //when no parser is found, shouldn't happen
+			unknown: '[Unknown]',
+			'null':'null',
+			undefined:'undefined',
+			'function':function( fn ){
+				var ret = 'function',
+					name = 'name' in fn ? fn.name : (reName.exec(fn)||[])[1];//functions never have name in IE
+				if( name )
+					ret += ' ' + name;
+				ret += '(';
+				
+				ret = [ ret, this.parse( fn, 'functionArgs' ), '){'].join('');
+				return join( ret, this.parse(fn,'functionCode'), '}' );
+			},
+			array: array,
+			nodelist: array,
+			arguments: array,
+			object:function( map ){
+				var ret = [ ];
+				this.up();
+				for( var key in map )
+					ret.push( this.parse(key,'key') + ': ' + this.parse(map[key]) );
+				this.down();
+				return join( '{', ret, '}' );
+			},
+			node:function( node ){
+				var open = this.HTML ? '&amp;lt;' : '&lt;',
+					close = this.HTML ? '&amp;gt;' : '&gt;';
+					
+				var tag = node.nodeName.toLowerCase(),
+					ret = open + tag;
+					
+				for( var a in this.DOMAttrs ){
+					var val = node[this.DOMAttrs[a]];
+					if( val )
+						ret += ' ' + a + '=' + this.parse( val, 'attribute' );
+				}
+				return ret + close + open + '/' + tag + close;
+			},
+			functionArgs:function( fn ){//function calls it internally, it's the arguments part of the function
+				var l = fn.length;
+				if( !l ) return '';				
+				
+				var args = Array(l);
+				while( l-- )
+					args[l] = String.fromCharCode(97+l);//97 is 'a'
+				return ' ' + args.join(', ') + ' ';
+			},
+			key:quote, //object calls it internally, the key part of an item in a map
+			functionCode:'[code]', //function calls it internally, it's the content of the function
+			attribute:quote, //node calls it internally, it's an html attribute value
+			string:quote,
+			date:quote,
+			regexp:literal, //regex
+			number:literal,
+			'boolean':literal
+		},
+		DOMAttrs:{//attributes to dump from nodes, name=&gt;realName
+			id:'id',
+			name:'name',
+			'class':'className'
+		},
+		HTML:false,//if true, entities are escaped ( &lt;, &gt;, \t, space and \n )
+		indentChar:'   ',//indentation unit
+		multiline:true //if true, items in a collection, are separated by a \n, else just a space.
+	};
+
+})();</diff>
      <filename>test/testrunner.js</filename>
    </modified>
    <modified>
      <diff>@@ -12,6 +12,8 @@ p.result { margin-left: 1em; }
 h2.pass { background-color: green; }
 h2.fail { background-color: red; }
 
+div.testrunner-toolbar { background: #eee; border-top: 1px solid black; padding: 10px; }
+
 ol#tests &gt; li &gt; strong { cursor:pointer; }
 
 div#fx-tests h4 {
@@ -115,4 +117,4 @@ div.chain.test div { background: green; }
 div.chain.out { background: green; }
 div.chain.out div { background: red; display: none; }
 
-div#show-tests * { display: none; }
\ No newline at end of file
+div#show-tests * { display: none; }</diff>
      <filename>test/testsuite.css</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>af73ac5e2e2b8c9e172a79d69efe17bc1d0133ab</id>
    </parent>
  </parents>
  <author>
    <name>Paul Mucur</name>
    <email>mudge@mudge.name</email>
  </author>
  <url>http://github.com/mudge/jquery_example/commit/864188d646a09cc8e97a95a453b731cdfa034016</url>
  <id>864188d646a09cc8e97a95a453b731cdfa034016</id>
  <committed-date>2009-01-22T07:20:59-08:00</committed-date>
  <authored-date>2009-01-22T07:20:59-08:00</authored-date>
  <message>Update QUnit.</message>
  <tree>7f305df2fd83de11c26379f37c70d7340e52c7f4</tree>
  <committer>
    <name>Paul Mucur</name>
    <email>mudge@mudge.name</email>
  </committer>
</commit>
