|
@@ -64,13 +64,13 @@ class ServerTests extends TestCase {
|
|
assertHasPrint("2");
|
|
assertHasPrint("2");
|
|
}
|
|
}
|
|
|
|
|
|
- function testDceEmpty() {
|
|
|
|
- vfs.putContent("Empty.hx", getTemplate("Empty.hx"));
|
|
|
|
- var args = ["-main", "Empty", "--no-output", "-java", "java"];
|
|
|
|
- runHaxe(args);
|
|
|
|
- runHaxeJson(args, cast "typer/compiledTypes" /* TODO */, {});
|
|
|
|
- assertHasField("", "Type", "enumIndex", true);
|
|
|
|
- }
|
|
|
|
|
|
+ // function testDceEmpty() {
|
|
|
|
+ // vfs.putContent("Empty.hx", getTemplate("Empty.hx"));
|
|
|
|
+ // var args = ["-main", "Empty", "--no-output", "-java", "java"];
|
|
|
|
+ // runHaxe(args);
|
|
|
|
+ // runHaxeJson(args, cast "typer/compiledTypes" /* TODO */, {});
|
|
|
|
+ // assertHasField("", "Type", "enumIndex", true);
|
|
|
|
+ // }
|
|
|
|
|
|
function testBuildMacro() {
|
|
function testBuildMacro() {
|
|
vfs.putContent("BuildMacro.hx", getTemplate("BuildMacro.hx"));
|
|
vfs.putContent("BuildMacro.hx", getTemplate("BuildMacro.hx"));
|
|
@@ -243,7 +243,6 @@ class ServerTests extends TestCase {
|
|
vfs.touchFile("haxe/ds/Vector.hx");
|
|
vfs.touchFile("haxe/ds/Vector.hx");
|
|
runHaxe(args);
|
|
runHaxe(args);
|
|
assertSuccess();
|
|
assertSuccess();
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// See https://github.com/HaxeFoundation/haxe/issues/8368#issuecomment-525379060
|
|
// See https://github.com/HaxeFoundation/haxe/issues/8368#issuecomment-525379060
|
|
@@ -265,16 +264,18 @@ class ServerTests extends TestCase {
|
|
var transform = Marker.extractMarkers(getTemplate("issues/Issue8368/MyMacro2.macro.hx"));
|
|
var transform = Marker.extractMarkers(getTemplate("issues/Issue8368/MyMacro2.macro.hx"));
|
|
var args = ["-main", "Main", "--macro", "define('whatever')"];
|
|
var args = ["-main", "Main", "--macro", "define('whatever')"];
|
|
|
|
|
|
- vfs.putContent(
|
|
|
|
- "MyMacro.macro.hx",
|
|
|
|
- transform.source.substr(0, transform.markers[1])
|
|
|
|
- + transform.source.substr(transform.markers[2], transform.source.length)
|
|
|
|
- );
|
|
|
|
|
|
+ vfs.putContent("MyMacro.macro.hx",
|
|
|
|
+ transform.source.substr(0, transform.markers[1]) + transform.source.substr(transform.markers[2], transform.source.length));
|
|
|
|
|
|
runHaxe(args);
|
|
runHaxe(args);
|
|
runHaxeJson([], ServerMethods.Invalidate, {file: new FsPath("MyMacro.macro.hx")});
|
|
runHaxeJson([], ServerMethods.Invalidate, {file: new FsPath("MyMacro.macro.hx")});
|
|
|
|
|
|
- var completionRequest = {file: new FsPath("MyMacro.macro.hx"), contents: transform.source, offset: transform.markers[2], wasAutoTriggered: false};
|
|
|
|
|
|
+ var completionRequest = {
|
|
|
|
+ file: new FsPath("MyMacro.macro.hx"),
|
|
|
|
+ contents: transform.source,
|
|
|
|
+ offset: transform.markers[2],
|
|
|
|
+ wasAutoTriggered: false
|
|
|
|
+ };
|
|
runHaxeJson(args, DisplayMethods.Completion, completionRequest);
|
|
runHaxeJson(args, DisplayMethods.Completion, completionRequest);
|
|
Assert.isTrue(parseCompletion().result.items.length == 23);
|
|
Assert.isTrue(parseCompletion().result.items.length == 23);
|
|
runHaxeJson(args, DisplayMethods.Completion, completionRequest);
|
|
runHaxeJson(args, DisplayMethods.Completion, completionRequest);
|
|
@@ -294,8 +295,10 @@ class ServerTests extends TestCase {
|
|
function runLoop() {
|
|
function runLoop() {
|
|
runHaxe(args.concat(["--display", "Empty.hx@0@diagnostics"]), () -> {
|
|
runHaxe(args.concat(["--display", "Empty.hx@0@diagnostics"]), () -> {
|
|
runHaxe(args.concat(["-D", "compile-only-define"]), () -> {
|
|
runHaxe(args.concat(["-D", "compile-only-define"]), () -> {
|
|
- if (assertSuccess() && ++runs < 20) runLoop();
|
|
|
|
- else async.done();
|
|
|
|
|
|
+ if (assertSuccess() && ++runs < 20)
|
|
|
|
+ runLoop();
|
|
|
|
+ else
|
|
|
|
+ async.done();
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}
|
|
}
|