Sfoglia il codice sorgente

Just check for compile, do not actually run the code

hughsando 8 anni fa
parent
commit
3934ffa88c
1 ha cambiato i file con 11 aggiunte e 6 eliminazioni
  1. 11 6
      tests/unit/src/unit/issues/Issue4988.hx

+ 11 - 6
tests/unit/src/unit/issues/Issue4988.hx

@@ -2,14 +2,19 @@ package unit.issues;
 
 class Issue4988 extends Test {
 	static var value:Dynamic;
+	static var actuallyRunCode = false;
 
 	function test() {
-		try {
-			var d:{i:Null<Int>} = null;
-			value = (d.i > 0);
-			t(false);
-		} catch(e:Dynamic) {
+		if (actuallyRunCode) {
+			try {
+				var d:{i:Null<Int>} = null;
+				value = (d.i > 0);
+				t(false);
+			} catch(e:Dynamic) {
+				t(true);
+			}
+		} else {
 			t(true);
 		}
 	}
-}
+}