Skip to content

Commit

Permalink
[tests] Update diagnostics tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Jul 3, 2024
1 parent ac735ed commit 90b7891
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
13 changes: 13 additions & 0 deletions tests/server/src/cases/issues/Issue11177.hx
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,17 @@ class Issue11177 extends TestCase {
// Assert.equals(0, res.length);
// });
// }

// function testLegacyDiagnostics(_) {
// vfs.putContent("Main.hx", getTemplate("issues/Issue11177/Main.hx"));
// vfs.putContent("Buttons.hx", getTemplate("issues/Issue11177/Buttons.hx"));
// vfs.putContent("KeyCode.hx", getTemplate("issues/Issue11177/KeyCode.hx"));
// var args = ["-main", "Main", "--interp"];
// runHaxe(args.concat(["--display", "Buttons.hx@0@diagnostics"]));
// vfs.putContent("Main.hx", getTemplate("issues/Issue11177/Main2.hx"));
// runHaxeJson([], ServerMethods.Invalidate, {file: new FsPath("Main.hx")});
// runHaxe(args);
// runHaxe(args.concat(["--display", "Buttons.hx@0@diagnostics"]));
// Assert.isTrue(lastResult.stderr.length == 2);
// }
}
16 changes: 15 additions & 1 deletion tests/server/src/cases/issues/Issue11184.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,28 @@ package cases.issues;

class Issue11184 extends TestCase {
// Disabled for now until #11184 is actually fixed, likely by #11220
// function test(_) {
// function testDiagnostics(_) {
// vfs.putContent("Main.hx", getTemplate("issues/Issue11184/Main.hx"));
// var args = ["-main", "Main", "-js", "bin/test.js"];

// runHaxeJsonCb(args, DisplayMethods.Diagnostics, {file: new FsPath("Main.hx")}, res -> {
// Assert.equals(1, res.length);
// Assert.equals(1, res[0].diagnostics.length);
// Assert.equals(res[0].diagnostics[0].args, "Cannot use Void as value");
// });

// runHaxe(args);
// Assert.isTrue(hasErrorMessage("Cannot use Void as value"));
// runHaxe(args);
// Assert.isTrue(hasErrorMessage("Cannot use Void as value"));
// }

// function testLegacyDiagnostics(_) {
// vfs.putContent("Main.hx", getTemplate("issues/Issue11184/Main.hx"));
// var args = ["-main", "Main", "-js", "bin/test.js"];
// runHaxe(args.concat(["--display", "Main.hx@0@diagnostics"]));
// final diagnostics = haxe.Json.parse(lastResult.stderr)[0].diagnostics;
// Assert.equals(diagnostics[0].args, "Cannot use Void as value");
// runHaxe(args);
// Assert.isTrue(hasErrorMessage("Cannot use Void as value"));
// runHaxe(args);
Expand Down

0 comments on commit 90b7891

Please sign in to comment.