Skip to content

Commit

Permalink
[tests] update display tests to use display/diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Nov 29, 2023
1 parent f7ea10a commit 8c4ed9f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/display/src/DisplayTestContext.hx
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,13 @@ class DisplayTestContext {
}

public function diagnostics():Array<Diagnostic<Dynamic>> {
var result = haxe.Json.parse(callHaxe('0@diagnostics'))[0];
return if (result == null) [] else result.diagnostics;
var args = ["--display", haxe.Json.stringify({jsonrpc:"2.0",id:0,method:"display/diagnostics",params:{"file":source.path}})];
var result = runHaxe(args, source.content);
if (result.hasError || result.stderr == "") {
throw new HaxeInvocationException(result.stderr, fieldName, args, source.content);
}
var result = haxe.Json.parse(result.stderr).result;
return if (result.result.length == 0) [] else result.result[0].diagnostics;
}

public function hasErrorMessage(f:()->Void, message:String) {
Expand Down

0 comments on commit 8c4ed9f

Please sign in to comment.