Changeset 294

Show
Ignore:
Timestamp:
02/16/08 16:23:01 (5 months ago)
Author:
ingy
Message:
Apply my local patches to Test.Simple
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/jsan/Test.Simple-0.21/lib/Test/Builder.js

    r293 r294  
    384384        if (args[i] != null) { 
    385385            args[i] = op == 'eq' ? "'" + args[i].toString() + "'" : args[i].valueOf(); 
    386         } 
    387     } 
     386 
     387            args[i] = args[i].replace(/&/g, '&');  
     388            args[i] = args[i].replace(/</g, '&lt;'); 
     389            args[i] = args[i].replace(/>/g, '&gt;'); 
     390            args[i] = args[i].replace(/"/g, '&quot;'); // " end quote for emacs 
     391        } 
     392    } 
     393 
    388394 
    389395    return this.diag( 
    390         "         got: " + args[0] + Test.Builder.LF + 
    391         "    expected: " + args[1] + Test.Builder.LF 
     396        "         got: \"" + args[0] + "\"" + Test.Builder.LF + 
     397        "    expected: \"" + args[1] + "\"" + Test.Builder.LF 
    392398    ); 
    393399}; 
     
    585591 
    586592            // Default to the normal write and scroll down... 
    587             doc.write(msg); 
     593            doc.write("<pre style='margin: 0px'>"+msg+"</pre>"); 
    588594            // IE 6 Service Pack 2 requires that we re-cache the object. Bill 
    589595            // Gates only knows why! 
     
    594600        this.output(writer); 
    595601        this.failureOutput(function (msg) { 
    596             writer('<span style="color: red; font-weight: boldvv">' 
     602            writer('<span style="color: red; font-weight: bold">' 
    597603                   + msg + '</span>') 
    598604        }); 
  • trunk/src/jsan/Test.Simple-0.21/lib/Test/Harness/Browser.js

    r293 r294  
    9393        // set to display:none. See: 
    9494        // http://www.quirksmode.org/bugreports/archives/2005/02/hidden_iframes.html 
    95         if (/Safari/.test(navigator.userAgent)) { 
     95        //alert(navigator.userAgent); 
     96        if (/Safari|Konqueror/.test(navigator.userAgent)) { 
    9697            node.style.visibility = "hidden"; 
    9798            node.style.height = "0";  
     
    108109        node.setAttribute("id", "output"); 
    109110        document.body.appendChild(node); 
     111        // Brutal hack to make output linkable 
     112        fixoutput = function(node) { 
     113            // Trailing space added and replaced to work around yet another 
     114            // Safari bug. 
     115            node.innerHTML = node.innerHTML.replace( 
     116                / ?(\w[\w\.]+?\w)(?=\.\.\.)/m, '<a href="$1">$1</a>' 
     117            ) + ' '; 
     118        }; 
    110119        return { 
    111120            pass: function (msg) { 
     
    113122                window.scrollTo(0, document.body.offsetHeight 
    114123                                || document.body.scrollHeight); 
     124                fixoutput(node); 
    115125            }, 
    116126            fail: function (msg) { 
     
    232242            if (/MSIE/.test(navigator.userAgent) 
    233243                || /Opera/.test(navigator.userAgent) 
    234                 || /Safari/.test(navigator.userAgent)) 
     244                || /Safari|Konqueror/.test(navigator.userAgent)) 
    235245            { 
    236246                // These browsers have problems with the DOM solution. It