Browse Source

Revert "[tests] temp disable a couple tests depending on server/readClassPath"

This reverts commit d9058e4a1b7188e744ac2893827752fce70419ad.
Rudy Ges 2 years ago
parent
commit
4a0de8c2e8
1 changed files with 44 additions and 44 deletions
  1. 44 44
      tests/server/src/cases/ServerTests.hx

+ 44 - 44
tests/server/src/cases/ServerTests.hx

@@ -176,50 +176,50 @@ class ServerTests extends TestCase {
 		assertReuse("HelloWorld");
 		assertReuse("HelloWorld");
 	}
 	}
 
 
-	// function testSyntaxCache() {
-	// 	vfs.putContent("HelloWorld.hx", getTemplate("HelloWorld.hx"));
-	// 	runHaxeJson(["-cp", "."], ServerMethods.ReadClassPaths, null);
-	// 	vfs.putContent("Empty.hx", "");
-	// 	runHaxeJson([], ServerMethods.ModuleCreated, {file: new FsPath("Empty.hx")});
-	// 	vfs.putContent("Empty.hx", getTemplate("Empty.hx"));
-	// 	runHaxeJson([], DisplayMethods.Completion, {file: new FsPath("HelloWorld.hx"), offset: 75, wasAutoTriggered: false});
-	// 	var completion = parseCompletion();
-	// 	assertHasCompletion(completion, module -> switch (module.kind) {
-	// 		case Type: module.args.path.typeName == "HelloWorld";
-	// 		case _: false;
-	// 	});
-	// 	assertHasCompletion(completion, module -> switch (module.kind) {
-	// 		case Type: module.args.path.typeName == "Empty";
-	// 		case _: false;
-	// 	});
-	// 	// check removal
-	// 	vfs.putContent("Empty.hx", "");
-	// 	runHaxeJson([], ServerMethods.Invalidate, {file: new FsPath("Empty.hx")});
-	// 	runHaxeJson([], DisplayMethods.Completion, {file: new FsPath("HelloWorld.hx"), offset: 75, wasAutoTriggered: false});
-	// 	var completion = parseCompletion();
-	// 	assertHasCompletion(completion, module -> switch (module.kind) {
-	// 		case Type: module.args.path.typeName == "HelloWorld";
-	// 		case _: false;
-	// 	});
-	// 	assertHasNoCompletion(completion, module -> switch (module.kind) {
-	// 		case Type: module.args.path.typeName == "Empty";
-	// 		case _: false;
-	// 	});
-	// }
-
-	// function testSyntaxCache2() {
-	// 	vfs.putContent("HelloWorld.hx", getTemplate("HelloWorld.hx"));
-	// 	var args = ["-cp", ".", "--interp"];
-	// 	runHaxeJson(args, ServerMethods.ReadClassPaths, null);
-	// 	vfs.putContent("Empty.hx", getTemplate("Empty.hx"));
-	// 	runHaxeJson([] /* No args here because file watchers don't generally know */, ServerMethods.ModuleCreated, {file: new FsPath("Empty.hx")});
-	// 	runHaxeJson(args, DisplayMethods.Completion, {file: new FsPath("HelloWorld.hx"), offset: 75, wasAutoTriggered: false});
-	// 	var completion = parseCompletion();
-	// 	assertHasCompletion(completion, module -> switch (module.kind) {
-	// 		case Type: module.args.path.typeName == "Empty";
-	// 		case _: false;
-	// 	});
-	// }
+	function testSyntaxCache() {
+		vfs.putContent("HelloWorld.hx", getTemplate("HelloWorld.hx"));
+		runHaxeJson(["-cp", "."], ServerMethods.ReadClassPaths, null);
+		vfs.putContent("Empty.hx", "");
+		runHaxeJson([], ServerMethods.ModuleCreated, {file: new FsPath("Empty.hx")});
+		vfs.putContent("Empty.hx", getTemplate("Empty.hx"));
+		runHaxeJson([], DisplayMethods.Completion, {file: new FsPath("HelloWorld.hx"), offset: 75, wasAutoTriggered: false});
+		var completion = parseCompletion();
+		assertHasCompletion(completion, module -> switch (module.kind) {
+			case Type: module.args.path.typeName == "HelloWorld";
+			case _: false;
+		});
+		assertHasCompletion(completion, module -> switch (module.kind) {
+			case Type: module.args.path.typeName == "Empty";
+			case _: false;
+		});
+		// check removal
+		vfs.putContent("Empty.hx", "");
+		runHaxeJson([], ServerMethods.Invalidate, {file: new FsPath("Empty.hx")});
+		runHaxeJson([], DisplayMethods.Completion, {file: new FsPath("HelloWorld.hx"), offset: 75, wasAutoTriggered: false});
+		var completion = parseCompletion();
+		assertHasCompletion(completion, module -> switch (module.kind) {
+			case Type: module.args.path.typeName == "HelloWorld";
+			case _: false;
+		});
+		assertHasNoCompletion(completion, module -> switch (module.kind) {
+			case Type: module.args.path.typeName == "Empty";
+			case _: false;
+		});
+	}
+
+	function testSyntaxCache2() {
+		vfs.putContent("HelloWorld.hx", getTemplate("HelloWorld.hx"));
+		var args = ["-cp", ".", "--interp"];
+		runHaxeJson(args, ServerMethods.ReadClassPaths, null);
+		vfs.putContent("Empty.hx", getTemplate("Empty.hx"));
+		runHaxeJson([] /* No args here because file watchers don't generally know */, ServerMethods.ModuleCreated, {file: new FsPath("Empty.hx")});
+		runHaxeJson(args, DisplayMethods.Completion, {file: new FsPath("HelloWorld.hx"), offset: 75, wasAutoTriggered: false});
+		var completion = parseCompletion();
+		assertHasCompletion(completion, module -> switch (module.kind) {
+			case Type: module.args.path.typeName == "Empty";
+			case _: false;
+		});
+	}
 
 
 	function testVectorInliner() {
 	function testVectorInliner() {
 		vfs.putContent("Vector.hx", getTemplate("Vector.hx"));
 		vfs.putContent("Vector.hx", getTemplate("Vector.hx"));