mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 00:00:49 +00:00
Add diff output as well.
This commit is contained in:
parent
d3f0196df7
commit
5c2a145bdf
|
@ -15,6 +15,7 @@
|
|||
|
||||
var fs = require('fs'),
|
||||
path = require('path'),
|
||||
jsDiff = require('diff'),
|
||||
HTML5 = require('html5').HTML5;
|
||||
|
||||
// @fixme wrap more or this setup in a common module
|
||||
|
@ -199,11 +200,19 @@ function processTest(item) {
|
|||
console.log('RAW RENDERED:');
|
||||
console.log(formatHTML(out) + "\n");
|
||||
|
||||
var a = formatHTML(normalizeHTML( item.result ));
|
||||
|
||||
console.log('NORMALIZED EXPECTED:');
|
||||
console.log(formatHTML(normalizeHTML( item.result )) + "\n");
|
||||
console.log(a + "\n");
|
||||
|
||||
var b = formatHTML(normalizeOut( out ));
|
||||
|
||||
console.log('NORMALIZED RENDERED:')
|
||||
console.log(formatHTML(normalizeOut(out)) + "\n");
|
||||
var patch = jsDiff.createPatch('wikitext.txt', a, b, 'before', 'after');
|
||||
|
||||
console.log('DIFF:');
|
||||
console.log(patch.replace(/^[^\n]*\n[^\n]*\n/, ''));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue