Skip to content

Commit

Permalink
check if the full suite makes things worse still
Browse files Browse the repository at this point in the history
  • Loading branch information
Simn committed Jan 25, 2024
1 parent 2be24cc commit 9125590
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 55 deletions.
78 changes: 40 additions & 38 deletions tests/server/src/cases/ServerTests.hx
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,18 @@ class ServerTests extends TestCase {
assertSkipping("BuildMacro", Tainted("server/invalidate"));
}

// function testBrokenSyntaxDiagnostics() {
// vfs.putContent("BrokenSyntax.hx", getTemplate("BrokenSyntax.hx"));
// vfs.putContent("Empty.hx", getTemplate("Empty.hx"));
// var args = ["-main", "BrokenSyntax.hx", "--interp", "--no-output"];
// runHaxe(args);
// assertErrorMessage("Expected }");
// runHaxeJsonCb(args, DisplayMethods.Diagnostics, {file: new FsPath("Empty.hx")}, res -> {
// Assert.equals(0, res.length);
// });
// runHaxe(args);
// assertErrorMessage("Expected }");
// }
function testBrokenSyntaxDiagnostics() {
vfs.putContent("BrokenSyntax.hx", getTemplate("BrokenSyntax.hx"));
vfs.putContent("Empty.hx", getTemplate("Empty.hx"));
var args = ["-main", "BrokenSyntax.hx", "--interp", "--no-output"];
runHaxe(args);
assertErrorMessage("Expected }");
runHaxeJsonCb(args, DisplayMethods.Diagnostics, {file: new FsPath("Empty.hx")}, res -> {
Assert.equals(0, res.length);
});
runHaxe(args);
assertErrorMessage("Expected }");
}

function testGlobalBuildMacro_subsequentCompilations() {
vfs.putContent("GlobalBuildMacro.hx", getTemplate("GlobalBuildMacro.hx"));
Expand Down Expand Up @@ -428,22 +428,24 @@ class ServerTests extends TestCase {
});
}

// function test10986() {
// vfs.putContent("Main.hx", getTemplate("issues/Issue10986/Main.hx"));
// vfs.putContent("haxe/ds/Vector.hx", getTemplate("issues/Issue10986/Vector.hx"));
// var args = ["-main", "Main", "--jvm", "Main.jar"];
// runHaxe(args);
// runHaxeJson([], ServerMethods.Invalidate, {file: new FsPath("haxe/ds/Vector.hx")});
// runHaxe(args);
// assertSuccess();
// }
// function test11179() {
// vfs.putContent("Main.hx", getTemplate("issues/Issue11179/Main.hx"));
// var args = ["-main", "Main", "--macro", 'nullSafety("Main", Strict)', "--interp"];
// runHaxe(args);
// runHaxe(args);
// assertSuccess();
// }
function test10986() {
vfs.putContent("Main.hx", getTemplate("issues/Issue10986/Main.hx"));
vfs.putContent("haxe/ds/Vector.hx", getTemplate("issues/Issue10986/Vector.hx"));
var args = ["-main", "Main", "--jvm", "Main.jar"];
runHaxe(args);
runHaxeJson([], ServerMethods.Invalidate, {file: new FsPath("haxe/ds/Vector.hx")});
runHaxe(args);
assertSuccess();
}

function test11179() {
vfs.putContent("Main.hx", getTemplate("issues/Issue11179/Main.hx"));
var args = ["-main", "Main", "--macro", 'nullSafety("Main", Strict)', "--interp"];
runHaxe(args);
runHaxe(args);
assertSuccess();
}

// See https://github.com/HaxeFoundation/haxe/issues/8368#issuecomment-525379060
#if false
function testXRedefinedFromX() {
Expand Down Expand Up @@ -529,14 +531,14 @@ class ServerTests extends TestCase {
Assert.isTrue(content == originalContent);
}

// function test9918() {
// vfs.putContent("Issue9918.hx", getTemplate("Issue9918.hx"));
// var args = ["-main", "Issue9918.hx"];
// runHaxe(args);
// assertHasPrint('Issue9918.hx:22: correct ECast count');
// runHaxe(args);
// assertHasPrint('Issue9918.hx:22: correct ECast count');
// runHaxe(args);
// assertHasPrint('Issue9918.hx:22: correct ECast count');
// }
function test9918() {
vfs.putContent("Issue9918.hx", getTemplate("Issue9918.hx"));
var args = ["-main", "Issue9918.hx"];
runHaxe(args);
assertHasPrint('Issue9918.hx:22: correct ECast count');
runHaxe(args);
assertHasPrint('Issue9918.hx:22: correct ECast count');
runHaxe(args);
assertHasPrint('Issue9918.hx:22: correct ECast count');
}
}
34 changes: 17 additions & 17 deletions tests/server/src/cases/issues/Issue10646.hx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
package cases.issues;

class Issue10646 extends TestCase {
// function test(_) {
// vfs.putContent("HelloWorld.hx", getTemplate("HelloWorld.hx"));
// var args = ["-main", "HelloWorld", "--neko", "test.n"];
// runHaxe(args);
// var nekoCtx = null;
// runHaxeJsonCb([], ServerMethods.Contexts, null, function(ctxs) {
// for (ctx in ctxs) {
// if (ctx.desc == "after_init_macros") {
// nekoCtx = ctx;
// }
// }
// });
// Assert.notNull(nekoCtx);
// runHaxeJsonCb([], ServerMethods.ContextMemory, {signature: nekoCtx.signature}, function(mem) {
// Assert.isNull(mem.leaks);
// });
// }
function test(_) {
vfs.putContent("HelloWorld.hx", getTemplate("HelloWorld.hx"));
var args = ["-main", "HelloWorld", "--neko", "test.n"];
runHaxe(args);
var nekoCtx = null;
runHaxeJsonCb([], ServerMethods.Contexts, null, function(ctxs) {
for (ctx in ctxs) {
if (ctx.desc == "after_init_macros") {
nekoCtx = ctx;
}
}
});
Assert.notNull(nekoCtx);
runHaxeJsonCb([], ServerMethods.ContextMemory, {signature: nekoCtx.signature}, function(mem) {
Assert.isNull(mem.leaks);
});
}
}

0 comments on commit 9125590

Please sign in to comment.