Browse Source

[jvm] add a test, closes #9210

Jens Fischer 5 years ago
parent
commit
0600211867

+ 14 - 0
tests/misc/java/projects/Issue9210/Main.java

@@ -0,0 +1,14 @@
+import haxe.ds.Option;
+
+class Main {
+	public static void main(String[] args) {
+		Option option = Option.Some("test");
+		if (option instanceof Option.Some) {
+			if (((Option.Some) option).v.equals("test")) {
+				System.exit(0);
+			}
+		}
+		System.out.println("Failed to match Some(\"test\").");
+		System.exit(1);
+	}
+}

+ 6 - 0
tests/misc/java/projects/Issue9210/Run.hx

@@ -0,0 +1,6 @@
+class Run {
+	static function main() {
+		var separator = if (Sys.systemName() == "Windows") ";" else ":";
+		Sys.exit(Sys.command('java -cp "bin/*${separator}bin" Main'));
+	}
+}

+ 11 - 0
tests/misc/java/projects/Issue9210/compile.hxml

@@ -0,0 +1,11 @@
+--java bin
+-D jvm
+haxe.ds.Option
+
+--next
+
+--cmd javac -d bin -cp "bin/*" Main.java
+
+--next
+
+--run Run