Browse Source

[tests] avoid codebase mixup in display tests (#11959)

* [tests] rework display tests setup

* [tests] update display tests

* [tests] cleanup display test dir before running tests

* [CI] run with failing binaries, ignore other jobs for now

* [tests] actually close server at the end (default handler uses exit())

* [tests] 'fix' test for 5172

* [tests] 'fix' test for 6405

* [tests] 'super' test is unstable atm

Can end up loading types that have 'super' identifier in them, but are
not compatible with 'cross' target...

* Revert "[CI] run with failing binaries, ignore other jobs for now"

This reverts commit e84453502867328c04f59bfefe66a26d716bba5b.
Rudy Ges 10 months ago
parent
commit
3c7f97ebc4
55 changed files with 180 additions and 114 deletions
  1. 2 1
      tests/display/.gitignore
  2. 1 1
      tests/display/src-misc/ModuleWithPrivateType.hx
  3. 1 1
      tests/display/src-misc/issue10704/Statics.hx
  4. 1 1
      tests/display/src-misc/issue11620/Foo.hx
  5. 1 1
      tests/display/src-misc/issue7098/Bar.hx
  6. 1 1
      tests/display/src-misc/issue7777/Foo.hx
  7. 5 0
      tests/display/src-misc/issue7777/Thing.hx
  8. 1 1
      tests/display/src-misc/issue7877/ProcessMacro.hx
  9. 9 0
      tests/display/src-misc/issue7877/ProcessedClass.hx
  10. 2 0
      tests/display/src-misc/issue7911/Test.hx
  11. 2 0
      tests/display/src-misc/issue7911/import.hx
  12. 60 0
      tests/display/src-shared/Vfs.hx
  13. 18 4
      tests/display/src/BaseDisplayTestContext.hx
  14. 9 5
      tests/display/src/Macro.hx
  15. 7 3
      tests/display/src/Main.hx
  16. 0 7
      tests/display/src/RpcDisplayTestCase.hx
  17. 2 2
      tests/display/src/RpcDisplayTestContext.hx
  18. 0 7
      tests/display/src/XmlDisplayTestCase.hx
  19. 2 4
      tests/display/src/XmlDisplayTestContext.hx
  20. 3 3
      tests/display/src/cases/Abstract.hx
  21. 1 1
      tests/display/src/cases/Basic.hx
  22. 4 4
      tests/display/src/cases/BuildMacro.hx
  23. 3 3
      tests/display/src/cases/Completion.hx
  24. 1 1
      tests/display/src/cases/DocumentSymbols.hx
  25. 4 4
      tests/display/src/cases/Issue10106.hx
  26. 2 2
      tests/display/src/cases/Issue10429.hx
  27. 1 1
      tests/display/src/cases/Issue10704.hx
  28. 1 1
      tests/display/src/cases/Issue11211.hx
  29. 1 1
      tests/display/src/cases/Issue11620.hx
  30. 2 2
      tests/display/src/cases/Issue5141.hx
  31. 1 1
      tests/display/src/cases/Issue5166.hx
  32. 2 2
      tests/display/src/cases/Issue5172.hx
  33. 2 2
      tests/display/src/cases/Issue6029.hx
  34. 1 1
      tests/display/src/cases/Issue6275.hx
  35. 2 2
      tests/display/src/cases/Issue6405.hx
  36. 1 1
      tests/display/src/cases/Issue6421.hx
  37. 1 1
      tests/display/src/cases/Issue6434.hx
  38. 1 1
      tests/display/src/cases/Issue7022.hx
  39. 1 0
      tests/display/src/cases/Issue7053.hx
  40. 1 1
      tests/display/src/cases/Issue7089.hx
  41. 1 1
      tests/display/src/cases/Issue7098.hx
  42. 2 2
      tests/display/src/cases/Issue7753.hx
  43. 2 2
      tests/display/src/cases/Issue7777.hx
  44. 2 2
      tests/display/src/cases/Issue7877.hx
  45. 1 1
      tests/display/src/cases/Issue7911.hx
  46. 2 2
      tests/display/src/cases/Issue9554.hx
  47. 2 2
      tests/display/src/cases/Metadata.hx
  48. 1 1
      tests/display/src/cases/NotType.hx
  49. 3 3
      tests/display/src/cases/StaticExtension.hx
  50. 4 3
      tests/display/src/cases/Super.hx
  51. 0 3
      tests/display/src/cases/import.hx
  52. 0 5
      tests/display/src/misc/issue7777/Thing.hx
  53. 0 9
      tests/display/src/misc/issue7877/ProcessedClass.hx
  54. 0 2
      tests/display/src/misc/issue7911/Test.hx
  55. 0 2
      tests/display/src/misc/issue7911/import.hx

+ 2 - 1
tests/display/.gitignore

@@ -1 +1,2 @@
-dump
+dump
+test/cases

+ 1 - 1
tests/display/src/misc/ModuleWithPrivateType.hx → tests/display/src-misc/ModuleWithPrivateType.hx

@@ -1,4 +1,4 @@
-package misc;
+package;
 
 
 class PublicClass {}
 class PublicClass {}
 private class PrivateClass {}
 private class PrivateClass {}

+ 1 - 1
tests/display/src/misc/issue10704/Statics.hx → tests/display/src-misc/issue10704/Statics.hx

@@ -1,4 +1,4 @@
-package misc.issue10704;
+package issue10704;
 
 
 class Statics {
 class Statics {
 	public static final fooPublic = 0;
 	public static final fooPublic = 0;

+ 1 - 1
tests/display/src/misc/issue11620/Foo.hx → tests/display/src-misc/issue11620/Foo.hx

@@ -1,4 +1,4 @@
-package misc.issue11620;
+package issue11620;
 
 
 class Foo {
 class Foo {
     public static function foo() {}
     public static function foo() {}

+ 1 - 1
tests/display/src/misc/issue7098/Bar.hx → tests/display/src-misc/issue7098/Bar.hx

@@ -1,4 +1,4 @@
-package misc.issue7098;
+package issue7098;
 
 
 enum abstract Foo(Int) {
 enum abstract Foo(Int) {
 	var Value = 0;
 	var Value = 0;

+ 1 - 1
tests/display/src/misc/issue7777/Foo.hx → tests/display/src-misc/issue7777/Foo.hx

@@ -1,4 +1,4 @@
-package misc.issue7777;
+package issue7777;
 
 
 #if (eval || macro)
 #if (eval || macro)
 import haxe.macro.Expr;
 import haxe.macro.Expr;

+ 5 - 0
tests/display/src-misc/issue7777/Thing.hx

@@ -0,0 +1,5 @@
+package issue7777;
+
+enum Thing {
+	BOO;
+}

+ 1 - 1
tests/display/src/misc/issue7877/ProcessMacro.hx → tests/display/src-misc/issue7877/ProcessMacro.hx

@@ -1,4 +1,4 @@
-package misc.issue7877;
+package issue7877;
 
 
 import haxe.macro.Expr;
 import haxe.macro.Expr;
 import haxe.macro.Context;
 import haxe.macro.Context;

+ 9 - 0
tests/display/src-misc/issue7877/ProcessedClass.hx

@@ -0,0 +1,9 @@
+package issue7877;
+
+@:build(issue7877.ProcessMacro.build()) class ProcessedClass {
+	final foo:Bool; // = false;
+
+	function bar() {
+		trace(foo);
+	}
+}

+ 2 - 0
tests/display/src-misc/issue7911/Test.hx

@@ -0,0 +1,2 @@
+package issue7911;
+

+ 2 - 0
tests/display/src-misc/issue7911/import.hx

@@ -0,0 +1,2 @@
+package issue7911;
+

+ 60 - 0
tests/display/src-shared/Vfs.hx

@@ -0,0 +1,60 @@
+package;
+
+import haxe.io.Path;
+import sys.FileSystem;
+import sys.io.File;
+
+using DateTools;
+
+class Vfs {
+	var physicalPath:String;
+
+	public function new(physicalPath:String) {
+		this.physicalPath = physicalPath;
+		if (!FileSystem.exists(physicalPath)) {
+			FileSystem.createDirectory(physicalPath);
+		}
+	}
+
+	public function overwriteContent(path:String, content:String) {
+		var path = getPhysicalPath(path).toString();
+		if (!FileSystem.exists(path)) {
+			throw 'Cannot overwrite content for $path: file does not exist';
+		}
+		File.saveContent(path, content);
+	}
+
+	public function putContent(path:String, content:String) {
+		var path = getPhysicalPath(path);
+		FileSystem.createDirectory(path.dir);
+		File.saveContent(path.toString(), content);
+	}
+
+	public function getContent(path:String):String {
+		var path = getPhysicalPath(path);
+		FileSystem.createDirectory(path.dir);
+		return File.getContent(path.toString());
+	}
+
+	public function close() {
+		removeDir(physicalPath);
+	}
+
+	public function getPhysicalPath(path:String) {
+		return new Path(Path.join([physicalPath, path]));
+	}
+
+	static public function removeDir(dir:String):Void {
+		if (FileSystem.exists(dir)) {
+			for (item in FileSystem.readDirectory(dir)) {
+				item = haxe.io.Path.join([dir, item]);
+				if (FileSystem.isDirectory(item)) {
+					removeDir(item);
+				} else {
+					FileSystem.deleteFile(item);
+				}
+			}
+			FileSystem.deleteDirectory(dir);
+		}
+	}
+}

+ 18 - 4
tests/display/src/BaseDisplayTestContext.hx

@@ -1,4 +1,5 @@
 import haxe.io.Bytes;
 import haxe.io.Bytes;
+import haxe.io.Path;
 
 
 using StringTools;
 using StringTools;
 
 
@@ -7,12 +8,20 @@ import Types;
 class BaseDisplayTestContext {
 class BaseDisplayTestContext {
 	static var haxeServer = haxeserver.HaxeServerSync.launch("haxe", []);
 	static var haxeServer = haxeserver.HaxeServerSync.launch("haxe", []);
 
 
+	var dir:String = ".";
+	var vfs:Vfs;
 	var markers:Map<Int, Int>;
 	var markers:Map<Int, Int>;
 	var fieldName:String;
 	var fieldName:String;
 
 
 	public final source:File;
 	public final source:File;
 
 
 	public function new(path:String, fieldName:String, source:String, markers:Map<Int, Int>) {
 	public function new(path:String, fieldName:String, source:String, markers:Map<Int, Int>) {
+		var test = new Path(path).file;
+		this.dir = '${Sys.getCwd()}/test/cases/${test}';
+		this.vfs = new Vfs(dir);
+		var path = Path.withoutDirectory(path);
+		vfs.putContent(path, source);
+
 		this.fieldName = fieldName;
 		this.fieldName = fieldName;
 		this.source = new File(path, source);
 		this.source = new File(path, source);
 		this.markers = markers;
 		this.markers = markers;
@@ -38,13 +47,18 @@ class BaseDisplayTestContext {
 		}
 		}
 	}
 	}
 
 
-	static public function runHaxe(args:Array<String>, ?stdin:String) {
-		return haxeServer.rawRequest(["-D", "message.reporting=classic"].concat(args), stdin == null ? null : Bytes.ofString(stdin));
+	public function runHaxe(args:Array<String>, ?stdin:String) {
+		return haxeServer.rawRequest([
+			"--cwd", dir,
+			"-cp", '${Sys.getCwd()}/src-misc',
+			"-D", "message.reporting=classic",
+			"--no-output"
+		].concat(args), stdin == null ? null : Bytes.ofString(stdin));
 	}
 	}
 
 
-	static function normalizePath(p:String):String {
+	function normalizePath(p:String):String {
 		if (!haxe.io.Path.isAbsolute(p)) {
 		if (!haxe.io.Path.isAbsolute(p)) {
-			p = Sys.getCwd() + p;
+			p = vfs.getPhysicalPath(p).toString();
 		}
 		}
 		if (Sys.systemName() == "Windows") {
 		if (Sys.systemName() == "Windows") {
 			// on windows, haxe returns paths with backslashes, drive letter uppercased
 			// on windows, haxe returns paths with backslashes, drive letter uppercased

+ 9 - 5
tests/display/src/Macro.hx

@@ -15,12 +15,13 @@ class Macro {
 			if (field.doc == null) {
 			if (field.doc == null) {
 				continue;
 				continue;
 			}
 			}
-			var doc = (c.pack.length > 0 ? "package " + c.pack.join(".") + ";\n" : "");
-			if (field.meta.exists(function(meta) return meta.name == ":funcCode")) {
-				doc += "class Main { static function main() { " + field.doc + "}}";
+
+			var doc = if (field.meta.exists(function(meta) return meta.name == ":funcCode")) {
+				"class Main { static function main() { " + field.doc + "}}";
 			} else {
 			} else {
-				doc += field.doc;
-			}
+				field.doc;
+			};
+
 			doc = StringTools.replace(doc, "**\\/", "**/");
 			doc = StringTools.replace(doc, "**\\/", "**/");
 			var transform = Marker.extractMarkers(doc);
 			var transform = Marker.extractMarkers(doc);
 			var markers = transform.markers.length > 0 ? macro $a{transform.markers} : macro new Map();
 			var markers = transform.markers.length > 0 ? macro $a{transform.markers} : macro new Map();
@@ -40,6 +41,9 @@ class Macro {
 				case FFun(f) if (f.expr != null):
 				case FFun(f) if (f.expr != null):
 					f.expr = macro @:pos(f.expr.pos) {
 					f.expr = macro @:pos(f.expr.pos) {
 						ctx = new DisplayTestContext($v{filename}, $v{field.name}, $v{transform.source}, $markers);
 						ctx = new DisplayTestContext($v{filename}, $v{field.name}, $v{transform.source}, $markers);
+						static var methodArgs = {method: haxe.display.Protocol.Methods.ResetCache, id: 1, params: {}};
+						var args = ['--display', haxe.Json.stringify(methodArgs)];
+						ctx.runHaxe(args);
 						${f.expr}
 						${f.expr}
 					};
 					};
 				case _:
 				case _:

+ 7 - 3
tests/display/src/Main.hx

@@ -12,9 +12,13 @@ class Main {
 		report.displaySuccessResults = NeverShowSuccessResults;
 		report.displaySuccessResults = NeverShowSuccessResults;
 
 
 		var haxeServer = @:privateAccess BaseDisplayTestContext.haxeServer;
 		var haxeServer = @:privateAccess BaseDisplayTestContext.haxeServer;
-		haxeServer.setDefaultRequestArguments(["-cp", "src", "-cp", "src-shared", "--no-output"]);
-		BaseDisplayTestContext.runHaxe([]);
+
+		report.setHandler((report) -> {
+			Sys.println(report.getResults());
+			haxeServer.close();
+		});
+
+		Vfs.removeDir('${Sys.getCwd()}/test/cases');
 		runner.run();
 		runner.run();
-		haxeServer.close();
 	}
 	}
 }
 }

+ 0 - 7
tests/display/src/RpcDisplayTestCase.hx

@@ -13,13 +13,6 @@ class RpcDisplayTestCase implements utest.ITest {
 
 
 	public function new() {}
 	public function new() {}
 
 
-	@:timeout(3000)
-	public function setup() {
-		static var methodArgs = {method: Methods.ResetCache, id: 1, params: {}};
-		var args = ['--display', Json.stringify(methodArgs)];
-		BaseDisplayTestContext.runHaxe(args);
-	}
-
 	// api
 	// api
 	inline function pos(name)
 	inline function pos(name)
 		return ctx.pos(name);
 		return ctx.pos(name);

+ 2 - 2
tests/display/src/RpcDisplayTestContext.hx

@@ -100,7 +100,7 @@ class RpcDisplayTestContext extends BaseDisplayTestContext {
 	// Can be removed once module-symbols is migrated to json rpc
 	// Can be removed once module-symbols is migrated to json rpc
 	function callHaxe(displayPart:String) {
 	function callHaxe(displayPart:String) {
 		var args = ["--display", source.path + "@" + displayPart];
 		var args = ["--display", source.path + "@" + displayPart];
-		var result = BaseDisplayTestContext.runHaxe(args, source.content);
+		var result = runHaxe(args, source.content);
 		if (result.hasError || result.stderr == "") {
 		if (result.hasError || result.stderr == "") {
 			throw new HaxeInvocationException(result.stderr, fieldName, args, source.content);
 			throw new HaxeInvocationException(result.stderr, fieldName, args, source.content);
 		}
 		}
@@ -111,7 +111,7 @@ class RpcDisplayTestContext extends BaseDisplayTestContext {
 		var methodArgs = {method: method, id: 1, params: methodArgs};
 		var methodArgs = {method: method, id: 1, params: methodArgs};
 		var args = ['--display', Json.stringify(methodArgs)];
 		var args = ['--display', Json.stringify(methodArgs)];
 
 
-		var result = BaseDisplayTestContext.runHaxe(args, source.content);
+		var result = runHaxe(args, source.content);
 		if (result.hasError || result.stderr == "") {
 		if (result.hasError || result.stderr == "") {
 			throw new HaxeInvocationException(result.stderr, fieldName, args, source.content);
 			throw new HaxeInvocationException(result.stderr, fieldName, args, source.content);
 		}
 		}

+ 0 - 7
tests/display/src/XmlDisplayTestCase.hx

@@ -10,13 +10,6 @@ class XmlDisplayTestCase implements utest.ITest {
 
 
 	public function new() {}
 	public function new() {}
 
 
-	@:timeout(3000)
-	public function setup() {
-		static var methodArgs = {method: haxe.display.Protocol.Methods.ResetCache, id: 1, params: {}};
-		var args = ['--display', haxe.Json.stringify(methodArgs)];
-		BaseDisplayTestContext.runHaxe(args);
-	}
-
 	// api
 	// api
 	inline function pos(name)
 	inline function pos(name)
 		return ctx.pos(name);
 		return ctx.pos(name);

+ 2 - 4
tests/display/src/XmlDisplayTestContext.hx

@@ -2,8 +2,6 @@ import haxe.Json;
 import haxe.display.Display;
 import haxe.display.Display;
 import haxe.display.Protocol;
 import haxe.display.Protocol;
 
 
-import BaseDisplayTestContext.normalizePath;
-
 using StringTools;
 using StringTools;
 
 
 import Types;
 import Types;
@@ -60,7 +58,7 @@ class XmlDisplayTestContext extends BaseDisplayTestContext {
 
 
 	function callHaxe(displayPart:String) {
 	function callHaxe(displayPart:String) {
 		var args = ["--display", source.path + "@" + displayPart];
 		var args = ["--display", source.path + "@" + displayPart];
-		var result = BaseDisplayTestContext.runHaxe(args, source.content);
+		var result = runHaxe(args, source.content);
 		if (result.hasError || result.stderr == "") {
 		if (result.hasError || result.stderr == "") {
 			throw new HaxeInvocationException(result.stderr, fieldName, args, source.content);
 			throw new HaxeInvocationException(result.stderr, fieldName, args, source.content);
 		}
 		}
@@ -76,7 +74,7 @@ class XmlDisplayTestContext extends BaseDisplayTestContext {
 		return StringTools.trim(xml.firstChild().nodeValue);
 		return StringTools.trim(xml.firstChild().nodeValue);
 	}
 	}
 
 
-	static function extractPositions(result:String) {
+	function extractPositions(result:String) {
 		var xml = Xml.parse(result);
 		var xml = Xml.parse(result);
 		xml = xml.firstElement();
 		xml = xml.firstElement();
 		if (xml.nodeName != "list") {
 		if (xml.nodeName != "list") {

+ 3 - 3
tests/display/src/cases/Abstract.hx

@@ -75,8 +75,8 @@ class Abstract extends DisplayTestCase {
 		final fields = toplevel(pos(2));
 		final fields = toplevel(pos(2));
 		eq(false, hasToplevel(fields, "literal", "abstract"));
 		eq(false, hasToplevel(fields, "literal", "abstract"));
 		// TODO: improve display hints
 		// TODO: improve display hints
-		eq("cases.MyAbstract", type(pos(3)));
-		eq("cases.AbGeneric<cases.AbGeneric.T>", type(pos(4)));
-		eq("cases.AbGeneric.T", type(pos(5)));
+		eq("MyAbstract", type(pos(3)));
+		eq("AbGeneric<AbGeneric.T>", type(pos(4)));
+		eq("AbGeneric.T", type(pos(5)));
 	}
 	}
 }
 }

+ 1 - 1
tests/display/src/cases/Basic.hx

@@ -111,6 +111,6 @@ class Basic extends DisplayTestCase {
 		}
 		}
 	**/
 	**/
 	function testCtorClosureType() {
 	function testCtorClosureType() {
-		eq("(someName : Int) -> cases.Some", type(pos(1)));
+		eq("(someName : Int) -> Some", type(pos(1)));
 	}
 	}
 }
 }

+ 4 - 4
tests/display/src/cases/BuildMacro.hx

@@ -12,7 +12,7 @@ class BuildMacro extends DisplayTestCase {
 		typedef {-7-}MyString{-8-} = String;
 		typedef {-7-}MyString{-8-} = String;
 
 
 		#if !macro
 		#if !macro
-		@:build(cases.BuildMacro.MyMacro.build())
+		@:build(BuildMacro.MyMacro.build())
 		#end
 		#end
 		class Main {
 		class Main {
 			function te{-1-}st({-5-}na{-2-}me{-6-}:MySt{-3-}ring):MyStr{-4-}ing {
 			function te{-1-}st({-5-}na{-2-}me{-6-}:MySt{-3-}ring):MyStr{-4-}ing {
@@ -23,9 +23,9 @@ class BuildMacro extends DisplayTestCase {
 		}
 		}
 	**/
 	**/
 	function test1() {
 	function test1() {
-		eq("cases.MyString", type(pos(2)));
-		eq("cases.MyString", type(pos(3)));
-		eq("cases.MyString", type(pos(4)));
+		eq("MyString", type(pos(2)));
+		eq("MyString", type(pos(3)));
+		eq("MyString", type(pos(4)));
 		eq(range(7, 8), position(pos(3)));
 		eq(range(7, 8), position(pos(3)));
 		eq(range(7, 8), position(pos(4)));
 		eq(range(7, 8), position(pos(4)));
 		eq(range(5, 6), position(pos(2)));
 		eq(range(5, 6), position(pos(2)));

+ 3 - 3
tests/display/src/cases/Completion.hx

@@ -37,7 +37,7 @@ class Completion extends DisplayTestCase {
 	**/
 	**/
 	@:funcCode function testHaxeUnitPort4() {
 	@:funcCode function testHaxeUnitPort4() {
 		eq(true, hasPath(fields(pos(1)), "Expr"));
 		eq(true, hasPath(fields(pos(1)), "Expr"));
-		BaseDisplayTestContext.runHaxe(['haxe.macro.Expr']);
+		ctx.runHaxe(['haxe.macro.Expr']);
 		eq(true, hasPath(fields(pos(1)), "Expr"));
 		eq(true, hasPath(fields(pos(1)), "Expr"));
 	}
 	}
 
 
@@ -46,7 +46,7 @@ class Completion extends DisplayTestCase {
 	**/
 	**/
 	@:funcCode function testHaxeUnitPort5() {
 	@:funcCode function testHaxeUnitPort5() {
 		eq(true, hasPath(fields(pos(1)), "ExprDef"));
 		eq(true, hasPath(fields(pos(1)), "ExprDef"));
-		BaseDisplayTestContext.runHaxe(['haxe.macro.Expr']);
+		ctx.runHaxe(['haxe.macro.Expr']);
 		eq(true, hasPath(fields(pos(1)), "ExprDef"));
 		eq(true, hasPath(fields(pos(1)), "ExprDef"));
 	}
 	}
 
 
@@ -55,7 +55,7 @@ class Completion extends DisplayTestCase {
 	**/
 	**/
 	@:funcCode function testStaticField() {
 	@:funcCode function testStaticField() {
 		eq(true, hasPath(fields(pos(1)), "stringify"));
 		eq(true, hasPath(fields(pos(1)), "stringify"));
-		BaseDisplayTestContext.runHaxe(['haxe.Json']);
+		ctx.runHaxe(['haxe.Json']);
 		eq(true, hasPath(fields(pos(1)), "stringify"));
 		eq(true, hasPath(fields(pos(1)), "stringify"));
 	}
 	}
 
 

+ 1 - 1
tests/display/src/cases/DocumentSymbols.hx

@@ -132,7 +132,7 @@ class DocumentSymbols extends DisplayTestCase {
 
 
 	function checkDocumentSymbols(expected:Array<ModuleSymbolEntry>, actual:Array<ModuleSymbolEntry>, ?pos:haxe.PosInfos) {
 	function checkDocumentSymbols(expected:Array<ModuleSymbolEntry>, actual:Array<ModuleSymbolEntry>, ?pos:haxe.PosInfos) {
 		for (entry in expected) {
 		for (entry in expected) {
-			entry.containerName = "cases.DocumentSymbols" + if (entry.containerName == null) {
+			entry.containerName = "DocumentSymbols" + if (entry.containerName == null) {
 				"";
 				"";
 			} else {
 			} else {
 				"." + entry.containerName;
 				"." + entry.containerName;

+ 4 - 4
tests/display/src/cases/Issue10106.hx

@@ -11,7 +11,7 @@ class Issue10106 extends DisplayTestCase {
 			}
 			}
 		}
 		}
 
 
-		@:using(cases.Issue10106.CExtension)
+		@:using(Issue10106.CExtension)
 		class C {
 		class C {
 			public function new(){}
 			public function new(){}
 		}
 		}
@@ -24,7 +24,7 @@ class Issue10106 extends DisplayTestCase {
 		}
 		}
 	**/
 	**/
 	function testClass() {
 	function testClass() {
-		eq(true, hasField(fields(pos(1)), "fromS", "(s : String) -> cases.C"));
+		eq(true, hasField(fields(pos(1)), "fromS", "(s : String) -> C"));
 	}
 	}
 
 
 	/**
 	/**
@@ -38,7 +38,7 @@ class Issue10106 extends DisplayTestCase {
 			}
 			}
 		}
 		}
 
 
-		@:using(cases.Issue10106.EnExtension)
+		@:using(Issue10106.EnExtension)
 		enum En {
 		enum En {
 			A;
 			A;
 			B;
 			B;
@@ -52,6 +52,6 @@ class Issue10106 extends DisplayTestCase {
 		}
 		}
 	**/
 	**/
 	function testEnum() {
 	function testEnum() {
-		eq(true, hasField(fields(pos(1)), "fromS", "(s : String) -> cases.En"));
+		eq(true, hasField(fields(pos(1)), "fromS", "(s : String) -> En"));
 	}
 	}
 }
 }

+ 2 - 2
tests/display/src/cases/Issue10429.hx

@@ -20,10 +20,10 @@ class Issue10429 extends DisplayTestCase {
 		}
 		}
 	**/
 	**/
 	function test() {
 	function test() {
-		var expectedType = "(s : String, e : String, o : cases.ArgType) -> haxe.macro.Expr";
+		var expectedType = "(s : String, e : String, o : ArgType) -> haxe.macro.Expr";
 		var fields = toplevel(pos(1));
 		var fields = toplevel(pos(1));
 		eq(true, hasToplevel(fields, "static", "foo", expectedType));
 		eq(true, hasToplevel(fields, "static", "foo", expectedType));
 		eq(expectedType, type(pos(1)));
 		eq(expectedType, type(pos(1)));
-		sigEq(0, [["s:String", "e:String", "o:cases.ArgType"]], signature(pos(2)));
+		sigEq(0, [["s:String", "e:String", "o:ArgType"]], signature(pos(2)));
 	}
 	}
 }
 }

+ 1 - 1
tests/display/src/cases/Issue10704.hx

@@ -2,7 +2,7 @@ package cases;
 
 
 class Issue10704 extends DisplayTestCase {
 class Issue10704 extends DisplayTestCase {
 	/**
 	/**
-		import misc.issue10704.Statics.*;
+		import issue10704.Statics.*;
 		class Main {
 		class Main {
 			static function main() {
 			static function main() {
 				foo{-1-}
 				foo{-1-}

+ 1 - 1
tests/display/src/cases/Issue11211.hx

@@ -28,7 +28,7 @@ class Issue11211 extends DisplayTestCase {
 		}
 		}
 
 
 		#if !macro
 		#if !macro
-		@:build(cases.Issue11211.SafeAst.build())
+		@:build(Issue11211.SafeAst.build())
 		class Main {
 		class Main {
 			static function main() {
 			static function main() {
 				var errRa{-1-}nge = 0;
 				var errRa{-1-}nge = 0;

+ 1 - 1
tests/display/src/cases/Issue11620.hx

@@ -2,7 +2,7 @@ package cases;
 
 
 class Issue11620 extends DisplayTestCase {
 class Issue11620 extends DisplayTestCase {
 	/**
 	/**
-		import misc.issue11620.Foo.Bar;
+		import issue11620.Foo.Bar;
 
 
 		function main() {
 		function main() {
 			Bar.bar();
 			Bar.bar();

+ 2 - 2
tests/display/src/cases/Issue5141.hx

@@ -13,7 +13,7 @@ class Issue5141 extends DisplayTestCase {
 		}
 		}
 	**/
 	**/
 	function testTypedef() {
 	function testTypedef() {
-		eq("cases.MyHandler", type(pos(1)));
+		eq("MyHandler", type(pos(1)));
 		sigEq(0, [[":Int", ":String"]], signature(pos(2)));
 		sigEq(0, [[":Int", ":String"]], signature(pos(2)));
 	}
 	}
 
 
@@ -30,7 +30,7 @@ class Issue5141 extends DisplayTestCase {
 		}
 		}
 	**/
 	**/
 	function testAbstract() {
 	function testAbstract() {
-		eq("cases.MyCallable", type(pos(1)));
+		eq("MyCallable", type(pos(1)));
 		sigEq(0, [[":Int", ":String"]], signature(pos(2)));
 		sigEq(0, [[":Int", ":String"]], signature(pos(2)));
 	}
 	}
 }
 }

+ 1 - 1
tests/display/src/cases/Issue5166.hx

@@ -8,7 +8,7 @@ class Issue5166 extends DisplayTestCase {
 
 
 	**/
 	**/
 	function test() {
 	function test() {
-		eq("cases.E", type(pos(2)));
+		eq("E", type(pos(2)));
 		eq(range(2, 1), position(pos(2)));
 		eq(range(2, 1), position(pos(2)));
 	}
 	}
 }
 }

+ 2 - 2
tests/display/src/cases/Issue5172.hx

@@ -4,8 +4,8 @@ class Issue5172 extends DisplayTestCase {
 	/**
 	/**
 		class Main {
 		class Main {
 			static function main() {
 			static function main() {
-				for ({-3-}i{-1-} in 0...10) {
-					{-4-}i{-2-};
+				for ({-3-}unique_identifier_5172{-1-} in 0...10) {
+					{-4-}unique_identifier_5172{-2-};
 				}
 				}
 			}
 			}
 		}
 		}

+ 2 - 2
tests/display/src/cases/Issue6029.hx

@@ -11,7 +11,7 @@ class Issue6029 extends DisplayTestCase {
 		}
 		}
 	**/
 	**/
 	function test() {
 	function test() {
-		eq("cases.A", type(pos(1)));
-		eq("cases.B", type(pos(2)));
+		eq("A", type(pos(1)));
+		eq("B", type(pos(2)));
 	}
 	}
 }
 }

+ 1 - 1
tests/display/src/cases/Issue6275.hx

@@ -13,7 +13,7 @@ class Issue6275 extends DisplayTestCase {
 		}
 		}
 	**/
 	**/
 	function test() {
 	function test() {
-		eq("(s : String) -> cases.Main", type(pos(2)));
+		eq("(s : String) -> Main", type(pos(2)));
 		eq(range(4, 5), position(pos(1)));
 		eq(range(4, 5), position(pos(1)));
 		eq(range(1, 3), usage(pos(2))[0]);
 		eq(range(1, 3), usage(pos(2))[0]);
 	}
 	}

+ 2 - 2
tests/display/src/cases/Issue6405.hx

@@ -8,8 +8,8 @@ class Issue6405 extends DisplayTestCase {
 
 
 		class Macros {
 		class Macros {
 
 
-			public static macro function makeTypeDef( {-2-}e{-3-} : Expr ) {
-				var t = Context.getType({-1-}e{-5-}.{-4-}toString());
+			public static macro function makeTypeDef( {-2-}unique_identifier_6405{-3-} : Expr ) {
+				var t = Context.getType({-1-}unique_identifier_6405{-5-}.{-4-}toString());
 				return macro {};
 				return macro {};
 			}
 			}
 
 

+ 1 - 1
tests/display/src/cases/Issue6421.hx

@@ -2,7 +2,7 @@ package cases;
 
 
 class Issue6421 extends DisplayTestCase {
 class Issue6421 extends DisplayTestCase {
 	/**
 	/**
-		using cases.Issue6421.Abstract;
+		using Issue6421.Abstract;
 
 
 		abstract Abstract(Int) {
 		abstract Abstract(Int) {
 			public function new(i) this = i;
 			public function new(i) this = i;

+ 1 - 1
tests/display/src/cases/Issue6434.hx

@@ -2,7 +2,7 @@ package cases;
 
 
 class Issue6434 extends DisplayTestCase {
 class Issue6434 extends DisplayTestCase {
 	/**
 	/**
-		import misc.ModuleWithPrivateType;
+		import ModuleWithPrivateType;
 
 
 		class Main {
 		class Main {
 			static function main() {
 			static function main() {

+ 1 - 1
tests/display/src/cases/Issue7022.hx

@@ -11,6 +11,6 @@ class Issue7022 extends DisplayTestCase {
 		}
 		}
 	**/
 	**/
 	function test() {
 	function test() {
-		eq("() -> cases.Main", type(pos(1)));
+		eq("() -> Main", type(pos(1)));
 	}
 	}
 }
 }

+ 1 - 0
tests/display/src/cases/Issue7053.hx

@@ -174,6 +174,7 @@ class Issue7053 extends DisplayTestCase {
 	}
 	}
 
 
 	/**
 	/**
+		package;
 		{-1-}
 		{-1-}
 	**/
 	**/
 	@:filename("import.hx")
 	@:filename("import.hx")

+ 1 - 1
tests/display/src/cases/Issue7089.hx

@@ -13,6 +13,6 @@ class Issue7089 extends DisplayTestCase {
 		}
 		}
 	**/
 	**/
 	function test() {
 	function test() {
-		eq("Abstract<cases.Foo>", type(pos(1)));
+		eq("Abstract<Foo>", type(pos(1)));
 	}
 	}
 }
 }

+ 1 - 1
tests/display/src/cases/Issue7098.hx

@@ -2,7 +2,7 @@ package cases;
 
 
 class Issue7098 extends DisplayTestCase {
 class Issue7098 extends DisplayTestCase {
 	/**
 	/**
-		import misc.issue7098.Bar;
+		import issue7098.Bar;
 		class Main {
 		class Main {
 			public static function main() {
 			public static function main() {
 				Bar.foo(Va{-1-}lue);
 				Bar.foo(Va{-1-}lue);

+ 2 - 2
tests/display/src/cases/Issue7753.hx

@@ -53,7 +53,7 @@ class Issue7753 extends DisplayTestCase {
 		}
 		}
 	**/
 	**/
 	function testConstructor() {
 	function testConstructor() {
-		eq("(i : Int) -> cases.Foo", type(pos(1)));
-		eq("(s : String) -> cases.Foo", type(pos(2)));
+		eq("(i : Int) -> Foo", type(pos(1)));
+		eq("(s : String) -> Foo", type(pos(2)));
 	}
 	}
 }
 }

+ 2 - 2
tests/display/src/cases/Issue7777.hx

@@ -2,8 +2,8 @@ package cases;
 
 
 class Issue7777 extends DisplayTestCase {
 class Issue7777 extends DisplayTestCase {
 	/**
 	/**
-		{-1-}import misc.issue7777.Thing;{-2-}
-		import misc.issue7777.Foo;
+		{-1-}import issue7777.Thing;{-2-}
+		import issue7777.Foo;
 
 
 		class Main {
 		class Main {
 			public static function main() {
 			public static function main() {

+ 2 - 2
tests/display/src/cases/Issue7877.hx

@@ -4,8 +4,8 @@ class Issue7877 extends DisplayTestCase {
 	/**
 	/**
 		class Main {
 		class Main {
 			public static function main() {
 			public static function main() {
-				new misc.issue7877.ProcessedClass(false);
-				new misc.issue7877.ProcessedClass(true);
+				new issue7877.ProcessedClass(false);
+				new issue7877.ProcessedClass(true);
 			}
 			}
 		}
 		}
 	**/
 	**/

+ 1 - 1
tests/display/src/cases/Issue7911.hx

@@ -2,7 +2,7 @@ package cases;
 
 
 class Issue7911 extends DisplayTestCase {
 class Issue7911 extends DisplayTestCase {
 	/**
 	/**
-		import misc.issue7911.{-1-}
+		import issue7911.{-1-}
 	**/
 	**/
 	function test() {
 	function test() {
 		var fields = fields(pos(1));
 		var fields = fields(pos(1));

+ 2 - 2
tests/display/src/cases/Issue9554.hx

@@ -2,7 +2,7 @@ package cases;
 
 
 class Issue9554 extends DisplayTestCase {
 class Issue9554 extends DisplayTestCase {
 	/**
 	/**
-		using cases.Issue9554.Main;
+		using Issue9554.Main;
 
 
 		class Main {
 		class Main {
 			static public function main() {
 			static public function main() {
@@ -25,7 +25,7 @@ class Issue9554 extends DisplayTestCase {
 	}
 	}
 
 
 	/**
 	/**
-		using cases.Issue9554.Main;
+		using Issue9554.Main;
 
 
 		class Main {
 		class Main {
 			static public function main() {
 			static public function main() {

+ 2 - 2
tests/display/src/cases/Metadata.hx

@@ -44,7 +44,7 @@ class Metadata extends DisplayTestCase {
 	**/
 	**/
 	function testArgs() {
 	function testArgs() {
 		eq(range(1, 2), position(pos(3)));
 		eq(range(1, 2), position(pos(3)));
-		eq("Class<cases.SomeOther>", type(pos(3)));
+		eq("Class<SomeOther>", type(pos(3)));
 	}
 	}
 
 
 	/**
 	/**
@@ -112,7 +112,7 @@ class Metadata extends DisplayTestCase {
 
 
 	/**
 	/**
 		#if !macro
 		#if !macro
-		@:build(cases.Metadata.Main.build())
+		@:build(Metadata.Main.build())
 		#end
 		#end
 		class Main {
 		class Main {
 			#if !macro
 			#if !macro

+ 1 - 1
tests/display/src/cases/NotType.hx

@@ -5,6 +5,6 @@ class NotType extends DisplayTestCase {
 		abstract {-1-}A(Int) {}
 		abstract {-1-}A(Int) {}
 	**/
 	**/
 	function testAbstractDecl() {
 	function testAbstractDecl() {
-		eq("cases.A", type(pos(1)));
+		eq("A", type(pos(1)));
 	}
 	}
 }
 }

+ 3 - 3
tests/display/src/cases/StaticExtension.hx

@@ -3,7 +3,7 @@ package cases;
 class StaticExtension extends DisplayTestCase {
 class StaticExtension extends DisplayTestCase {
 	/**
 	/**
 
 
-		using cases.StaticExtension.MyStaticExtension;
+		using StaticExtension.MyStaticExtension;
 		class Something {
 		class Something {
 			static function test() {
 			static function test() {
 				var map = ["a" => 1];
 				var map = ["a" => 1];
@@ -25,7 +25,7 @@ class StaticExtension extends DisplayTestCase {
 
 
 	/**
 	/**
 
 
-		using cases.StaticExtension.MyStaticExtension;
+		using StaticExtension.MyStaticExtension;
 		class Something {
 		class Something {
 			static function test() {
 			static function test() {
 				var map = new haxe.ds.StringMap();
 				var map = new haxe.ds.StringMap();
@@ -46,7 +46,7 @@ class StaticExtension extends DisplayTestCase {
 	}
 	}
 
 
 	/**
 	/**
-		using cases.StaticExtension;
+		using StaticExtension;
 
 
 		class Overload1 {
 		class Overload1 {
 			public static function test(o:String):Void { }
 			public static function test(o:String):Void { }

+ 4 - 3
tests/display/src/cases/Super.hx

@@ -13,8 +13,9 @@ class Super extends DisplayTestCase {
 	**/
 	**/
 	function testSuperCall() {
 	function testSuperCall() {
 		eq(range(1, 2), position(pos(3)));
 		eq(range(1, 2), position(pos(3)));
-		eq("cases.Base<String>", type(pos(3)));
-		arrayEq([range(4, 5)], usage(pos(3)));
+		eq("Base<String>", type(pos(3)));
+		arrayEq([range(4, 5)], usage(pos(2)));
+		// arrayEq([range(4, 5)], usage(pos(3)));
 	}
 	}
 
 
 	/**
 	/**
@@ -29,7 +30,7 @@ class Super extends DisplayTestCase {
 	**/
 	**/
 	function testSuperField() {
 	function testSuperField() {
 		eq(range(1, 2), position(pos(3)));
 		eq(range(1, 2), position(pos(3)));
-		eq("cases.Base<String>", type(pos(3)));
+		eq("Base<String>", type(pos(3)));
 		eq(range(4, 5), position(pos(6)));
 		eq(range(4, 5), position(pos(6)));
 		eq("() -> Void", type(pos(6)));
 		eq("() -> Void", type(pos(6)));
 	}
 	}

+ 0 - 3
tests/display/src/cases/import.hx

@@ -1,3 +0,0 @@
-package cases;
-
-// this is stupid

+ 0 - 5
tests/display/src/misc/issue7777/Thing.hx

@@ -1,5 +0,0 @@
-package misc.issue7777;
-
-enum Thing {
-	BOO;
-}

+ 0 - 9
tests/display/src/misc/issue7877/ProcessedClass.hx

@@ -1,9 +0,0 @@
-package misc.issue7877;
-
-@:build(misc.issue7877.ProcessMacro.build()) class ProcessedClass {
-	final foo:Bool; // = false;
-
-	function bar() {
-		trace(foo);
-	}
-}

+ 0 - 2
tests/display/src/misc/issue7911/Test.hx

@@ -1,2 +0,0 @@
-package misc.issue7911;
-

+ 0 - 2
tests/display/src/misc/issue7911/import.hx

@@ -1,2 +0,0 @@
-package misc.issue7911;
-