浏览代码

Just check for compile, do not actually run the code

hughsando 8 年之前
父节点
当前提交
3934ffa88c
共有 1 个文件被更改,包括 11 次插入6 次删除
  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);
 		}
 	}
-}
+}