Bläddra i källkod

[tests] add test for #9636

Rudy Ges 2 år sedan
förälder
incheckning
68280ac20d

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

@@ -0,0 +1,15 @@
+package cases.issues;
+
+class Issue9636 extends TestCase {
+	function test(_) {
+		vfs.putContent('Main.hx', getTemplate('issues/Issue9636/Main.hx'));
+		var args = ['--main', 'Main', '--macro', 'include("pack")', '--js', 'test.js'];
+		runHaxe(args);
+		assertSuccess();
+		vfs.putContent('pack/Foo.hx', getTemplate('issues/Issue9636/Foo.hx'));
+		runHaxe(args);
+		assertSuccess();
+		runHaxe(['--cmd', 'node test.js']);
+		Assert.isTrue(lastResult.stderr.contains('Exception from Foo'));
+	}
+}

+ 6 - 0
tests/server/test/templates/issues/Issue9636/Foo.hx

@@ -0,0 +1,6 @@
+package pack;
+
+class Foo {
+	static function __init__() throw "Exception from Foo";
+	public static function bar() {}
+}

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

@@ -0,0 +1,6 @@
+
+class Main {
+	static public function main() {
+		trace("hello world");
+	}
+}