2
0
Эх сурвалжийг харах

[tests] add test for #10677

closes #10677
Simon Krajewski 3 жил өмнө
parent
commit
034f269064

+ 15 - 0
tests/server/src/cases/issues/Issue10677.hx

@@ -0,0 +1,15 @@
+package cases.issues;
+
+class Issue10677 extends TestCase {
+	function test(_) {
+		vfs.putContent("Main.hx", getTemplate("issues/Issue10677/Main.hx"));
+		vfs.putContent("Polygon.hx", getTemplate("issues/Issue10677/Polygon.hx"));
+		vfs.putContent("Polygons.hx", getTemplate("issues/Issue10677/Polygons.hx"));
+		vfs.putContent("PolygonCollider.hx", getTemplate("issues/Issue10677/PolygonCollider.hx"));
+		var args = ["--main", "Main.hx", "--no-output"];
+		runHaxe(args);
+		runHaxeJson(args, ServerMethods.Invalidate, {file: new FsPath("Main.hx")});
+		runHaxe(args);
+		Assert.isFalse(lastResult.hasError);
+	}
+}

+ 6 - 0
tests/server/test/templates/issues/Issue10677/Main.hx

@@ -0,0 +1,6 @@
+class Main {
+	static function main() {
+		trace(Polygons);
+		Polygon.x = Main;
+	}
+}

+ 3 - 0
tests/server/test/templates/issues/Issue10677/Polygon.hx

@@ -0,0 +1,3 @@
+class Polygon {
+	static public var x:Class<Main>;
+}

+ 3 - 0
tests/server/test/templates/issues/Issue10677/PolygonCollider.hx

@@ -0,0 +1,3 @@
+class PolygonCollider {
+	static public var p:Polygons;
+}

+ 4 - 0
tests/server/test/templates/issues/Issue10677/Polygons.hx

@@ -0,0 +1,4 @@
+class Polygons {
+	static public var c:PolygonCollider;
+	static public var p:Polygon;
+}