Procházet zdrojové kódy

make feq a bit less precise for flash tests

Simon Krajewski před 11 roky
rodič
revize
ab7e36bb94

+ 1 - 1
tests/unit/Test.hx

@@ -22,7 +22,7 @@ class Test #if swf_mark implements mt.Protect #end {
 		count++;
 		if (!Math.isFinite(v) || !Math.isFinite(v2))
 			eq(v, v2, pos);
-		else if ( Math.abs(v - v2) > 1e-15 ) {
+		else if ( Math.abs(v - v2) > 1e-10 ) {
 			report(v+" should be "+v2,pos);
 			success = false;
 		}

+ 1 - 1
tests/unit/UnitBuilder.hx

@@ -77,7 +77,7 @@ class UnitBuilder {
 	
 	static function mkEq(e1, e2, p) {
 		function isFloat(e) {
-			try return switch(Context.typeof(e)) {
+			try return switch(Context.follow(Context.typeof(e))) {
 				case TAbstract(tr, _):
 					tr.get().name == "Float";
 				case _:

+ 1 - 1
tests/unit/unitstd/Math.unit.hx

@@ -139,7 +139,7 @@ Math.log(Math.POSITIVE_INFINITY) == Math.POSITIVE_INFINITY;
 // exp + log
 var floats = [1.33, 12.0, -112.999992, 0.0, Math.NEGATIVE_INFINITY, Math.POSITIVE_INFINITY];
 for (f in floats) {
-	Math.log(Math.exp(f)) == f;
+	feq(Math.log(Math.exp(f)), f);
 }
 
 // sqrt