소스 검색

added TestCasts

Nicolas Cannasse 7 년 전
부모
커밋
3b8ba30777
2개의 변경된 파일17개의 추가작업 그리고 0개의 파일을 삭제
  1. 16 0
      tests/unit/src/unit/TestCasts.hx
  2. 1 0
      tests/unit/src/unit/TestMain.hx

+ 16 - 0
tests/unit/src/unit/TestCasts.hx

@@ -0,0 +1,16 @@
+package unit;
+
+class TestCasts extends Test  {
+
+	static function foo( f : Float ) {
+		return f;
+	}
+
+	static function make( f : Dynamic ) return f;
+
+	function testCasts() {
+		var f : Int -> Float = make(foo);
+		eq( f(123), 123);
+	}
+
+}

+ 1 - 0
tests/unit/src/unit/TestMain.hx

@@ -63,6 +63,7 @@ class TestMain {
 			new TestGADT(),
 			new TestGeneric(),
 			new TestArrowFunctions(),
+			new TestCasts(),
 			#if !no_pattern_matching
 			new TestMatch(),
 			#end