Home page Forum Wiki Mail Jabber Devel NIX-FILES

AltLUG Git

Git-repositories of Altai Linux User Group

Merge branch 'prettydiff'
authorjzaefferer <joern.zaefferer@gmail.com>
Sat, 27 Nov 2010 15:35:39 +0000 (16:35 +0100)
committerjzaefferer <joern.zaefferer@gmail.com>
Sat, 27 Nov 2010 15:35:39 +0000 (16:35 +0100)
Conflicts:
qunit/qunit.js
test/test.js

1  2 
qunit/qunit.css
qunit/qunit.js
test/test.js

diff --cc qunit/qunit.css
Simple merge
diff --cc qunit/qunit.js
@@@ -482,31 -469,6 +482,33 @@@ extend(QUnit, 
                return undefined;
        },
        
-               var output = message + ', expected: <span class="test-expected">' + expected + '</span>';
 +      push: function(result, actual, expected, message) {
 +              var details = {
 +                      result: result,
 +                      message: message,
 +                      actual: actual,
 +                      expected: expected
 +              };
 +              
 +              message = escapeHtml(message) || (result ? "okay" : "failed");
 +              message = '<span class="test-message">' + message + "</span>";
 +              expected = escapeHtml(QUnit.jsDump.parse(expected));
 +              actual = escapeHtml(QUnit.jsDump.parse(actual));
-                       output += ' result: <span class="test-actual">' + actual + '</span>, diff: ' + QUnit.diff(expected, actual);
++              var output = message + '<table><tr class="test-expected"><th>Expected: </th><td><pre>' + expected + '</pre></td></tr>';
 +              if (actual != expected) {
++                      output += '<tr class="test-actual"><th>Result: </th><td><pre>' + actual + '</pre></td></tr>';
++                      output += '<tr class="test-diff"><th>Diff: </th><td><pre>' + QUnit.diff(expected, actual) +'</pre></td></tr>';
 +              }
++              output += "</table>";
 +              
 +              QUnit.log(result, message, details);
 +              
 +              config.assertions.push({
 +                      result: !!result,
 +                      message: output
 +              });
 +      },
 +      
        // Logging callbacks
        begin: function() {},
        done: function(failures, total) {},
diff --cc test/test.js
@@@ -194,11 -196,11 +194,11 @@@ test("each test can extend the module t
  
  module("jsDump");
  test("jsDump output", function() {
-       equals( QUnit.jsDump.parse([1, 2]), "[ 1, 2 ]" );
-       equals( QUnit.jsDump.parse({top: 5, left: 0}), "{ \"top\": 5, \"left\": 0 }" );
+       equals( QUnit.jsDump.parse([1, 2]), "[\n  1,\n  2\n]" );
+       equals( QUnit.jsDump.parse({top: 5, left: 0}), "{\n  \"top\": 5,\n  \"left\": 0\n}" );
 -      if (typeof document !== 'undefined') {
 +      if (typeof document !== 'undefined' && document.getElementById("qunit-header")) {
                equals( QUnit.jsDump.parse(document.getElementById("qunit-header")), "<h1 id=\"qunit-header\"></h1>" );
-               equals( QUnit.jsDump.parse(document.getElementsByTagName("h1")), "[ <h1 id=\"qunit-header\"></h1> ]" );
+               equals( QUnit.jsDump.parse(document.getElementsByTagName("h1")), "[\n  <h1 id=\"qunit-header\"></h1>\n]" );
        }
  });
  

Hosting is provided AltSPAHow to use Git
Please direct any questions on jabber alex.wolf@jabber.ru

Valid HTML 4.0 Transitional Valid CSS!

Designer Alexander Wolf