Skip to content

Commit

Permalink
[tests] improve json rpc handling
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz authored and 0b1kn00b committed Jan 25, 2024
1 parent 77f9fde commit 5b9e150
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/misc/src/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ class Main {
.filter(s -> 0 != s.indexOf('Picked up JAVA_TOOL_OPTIONS:'))
.join('\n');

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 (_) {}
}

if (content != expected) {
final a = new diff.FileData(Bytes.ofString(expected), "expected", Date.now());
final b = new diff.FileData(Bytes.ofString(content), "actual", Date.now());
Expand Down

0 comments on commit 5b9e150

Please sign in to comment.