If two string differ on some white space characters this is not visible in the diff, because only the characters are colored. This makes debugging string formatting issues using equality assertions very hard.
Also if you compare two strings on a windows machine and one of the strings has carriage return \r characters blank lines will be inserted between each numbered row of the diff.
edit: we have to apply something like this to get whitespace diff visible:
var debugWhiteSpace = function(str) {
return str.replace(/\r/g, "\\r").replace(/\n/g, "\\n").replace(/\t/g, "\\t").replace(/ /g, "\\s");
};
If two string differ on some white space characters this is not visible in the diff, because only the characters are colored. This makes debugging string formatting issues using equality assertions very hard.
Also if you compare two strings on a windows machine and one of the strings has carriage return
\rcharacters blank lines will be inserted between each numbered row of the diff.edit: we have to apply something like this to get whitespace diff visible: