浏览代码

add unit/issues

Simon Krajewski 11 年之前
父节点
当前提交
69b559e7c4
共有 3 个文件被更改,包括 28 次插入0 次删除
  1. 1 0
      tests/unit/Test.hx
  2. 9 0
      tests/unit/issues/2623.issue.hx
  3. 18 0
      tests/unit/issues/TestIssues.hx

+ 1 - 0
tests/unit/Test.hx

@@ -270,6 +270,7 @@ class Test #if swf_mark implements mt.Protect #end {
 			new TestMatch(),
 			#end
 			new TestSpecification(),
+			new unit.issues.TestIssues(),
 			#if cs
 			new TestCSharp(),
 			#end

+ 9 - 0
tests/unit/issues/2623.issue.hx

@@ -0,0 +1,9 @@
+var v1:E1 = A(1);
+var v2 = A("foo");
+var v3:E1 = B;
+var v4 = B;
+
+Type.getEnum(v1) == E1;
+Type.getEnum(v2) == E2;
+Type.getEnum(v3) == E1;
+Type.getEnum(v4) == E2;

+ 18 - 0
tests/unit/issues/TestIssues.hx

@@ -0,0 +1,18 @@
+package unit.issues;
+
+enum E1 {
+	A(i:Int);
+	B;
+}
+
+enum E2 {
+	A(s:String);
+	B;
+}
+
+#if !macro
+@:build(unit.UnitBuilder.build("issues", ".issue.hx"))
+#end
+class TestIssues extends Test {
+
+}