Fixed bug in testsuite, tried to fix problem with :selected in Opera 8.54: It does...
[jquery.git] / build / test / data / testrunner.js
index db97215..398ef3d 100644 (file)
@@ -50,12 +50,12 @@ function runTest(tests) {
 }
 
 function test(name, callback) {
-       Test = [];
        synchronize(function() {
+               Test = [];
                try {
                        callback();
                } catch(e) {
-                       if(typeof console != "undefined") {
+                       if( typeof console != "undefined" && console.error && console.warn ) {
                                console.error("Test " + name + " died, exception and test follows");
                                console.error(e);
                                console.warn(callback.toString());
@@ -129,9 +129,10 @@ function isSet(a, b, msg) {
                                ret = false;
        } else
                ret = false;
-       if ( !ret && console )
-               console.log( msg, a, b );
-       Test.push( [ ret, msg ] );
+       if ( !ret )
+               Test.push( [ ret, msg + " expected: " + b + " result: " + a ] );
+       else 
+               Test.push( [ ret, msg ] );
 }
 
 /**