diff --git a/tests/misc/src/Main.hx b/tests/misc/src/Main.hx index 63607bdd21a..006fcfad174 100644 --- a/tests/misc/src/Main.hx +++ b/tests/misc/src/Main.hx @@ -151,15 +151,15 @@ class Main { .filter(s -> 0 != s.indexOf('Picked up JAVA_TOOL_OPTIONS:')) .join('\n'); - content = hideStdPositions(content); - expected = hideStdPositions(expected); - if (StringTools.startsWith(content, '{"jsonrpc":')) { try { content = haxe.Json.stringify(haxe.Json.parse(content).result.result); // Reorder fields from expected too expected = haxe.Json.stringify(haxe.Json.parse(expected)); } catch (_) {} + } else { + content = hideStdPositions(content); + expected = hideStdPositions(expected); } if (content != expected) { @@ -182,8 +182,7 @@ class Main { } static function hideStdPositions(content:String):String { - var std = Path.removeTrailingSlashes(getStd()); - var regex = new EReg(std + '([a-z/]+\\.hx):[0-9]+:( characters? [0-9]+(-[0-9]+)( :)?)', 'i'); + var regex = new EReg(getStd() + '([a-z/]+\\.hx):[0-9]+:( characters? [0-9]+(-[0-9]+)( :)?)', 'i'); return content.split("\n") .map(line -> regex.replace(line, "$1:???:"))