Browse Source

Add code to check #5247

Cauê Waneck 9 years ago
parent
commit
ff64510bb9
1 changed files with 18 additions and 0 deletions
  1. 18 0
      tests/unit/src/unit/TestCSharp.hx

+ 18 - 0
tests/unit/src/unit/TestCSharp.hx

@@ -397,6 +397,24 @@ class TestCSharp extends Test
 		//issue #2308
 		var fn = getEnumValue;
 		eq(0x100, Reflect.callMethod(null, fn, [TEnumWithValue.TVA]));
+
+		var e = getTVA();
+		switch(e) {
+			case TVA if (getEnumValue(e) == getEnumValue(getTVA())):
+				t(true);
+			case _:
+				t(false);
+		}
+
+		var e = getTVB();
+		switch(e) {
+			case TVA:
+				t(false);
+			case TVB if (getEnumValue(e) != getEnumValue(getTVA())):
+				t(true);
+			case _:
+				t(false);
+		}
 	}
 
 	static function getEnumValue(e:TEnumWithValue):Int