瀏覽代碼

minor php fixes (prevent abort)
added one more test

Nicolas Cannasse 17 年之前
父節點
當前提交
56cdb48392
共有 3 個文件被更改,包括 33 次插入0 次删除
  1. 6 0
      tests/unit/TestBasetypes.hx
  2. 19 0
      tests/unit/TestLocals.hx
  3. 8 0
      tests/unit/TestMisc.hx

+ 6 - 0
tests/unit/TestBasetypes.hx

@@ -7,6 +7,12 @@ class TestBasetypes extends Test {
 		eq( a.length, 3 );
 		eq( a[0], 1 );
 		eq( a[2], 3 );
+
+		#if php
+		assert();
+		return;
+		#end
+
 		eq( a[3], null );
 		eq( a[1000], null );
 		eq( a[-1], null );

+ 19 - 0
tests/unit/TestLocals.hx

@@ -56,6 +56,11 @@ class TestLocals extends Test {
 	}
 
 	function testCapture() {
+		#if php
+		assert();
+		return;
+		#end
+
 		// read
 		var funs = new Array();
 		for( i in 0...5 )
@@ -94,6 +99,10 @@ class TestLocals extends Test {
 	}
 
 	function testSubCapture() {
+		#if php
+		assert();
+		return;
+		#end
 		var funs = new Array();
 		for( i in 0...5 )
 			funs.push(function() {
@@ -110,6 +119,11 @@ class TestLocals extends Test {
 	}
 
 	function testParallelCapture() {
+		#if php
+		assert();
+		return;
+		#end
+
 		var funs = new Array();
 		for( i in 0...5 ) {
 			if( true ) {
@@ -126,6 +140,11 @@ class TestLocals extends Test {
 	}
 
 	function testPossibleBug() {
+		#if php
+		assert();
+		return;
+		#end
+
 		var funs = new Array();
 		for( i in 0...5 )
 			funs.push(function(i) return i);

+ 8 - 0
tests/unit/TestMisc.hx

@@ -60,4 +60,12 @@ class TestMisc extends Test {
 		eq( opt2().y, "hello" );
 	}
 
+	function testIncr() {
+		var x = 0;
+		var arr = [3];
+		eq( arr[x++]++, 3 );
+		eq( x, 1 );
+		eq( arr[0], 4 );
+	}
+
 }