handle different string formating of float values

This commit is contained in:
Volker Berlin 2019-07-13 20:17:23 +02:00
parent c15bea7d3d
commit ed0eb9e4b6

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2017 - 2018 Volker Berlin (i-net software) * Copyright 2017 - 2019 Volker Berlin (i-net software)
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -356,6 +356,8 @@ public class WasmRule extends TemporaryFolder {
String actual = evalWasm( script, methodName, params ); String actual = evalWasm( script, methodName, params );
if( expected instanceof Double ) { // handle different string formating of double values if( expected instanceof Double ) { // handle different string formating of double values
assertEquals( actual, expected, Double.valueOf( actual ) ); assertEquals( actual, expected, Double.valueOf( actual ) );
} else if( expected instanceof Float ) { // handle different string formating of float values
assertEquals( actual, expected, Float.valueOf( actual ) );
} else { } else {
assertEquals( String.valueOf( expected ), actual ); assertEquals( String.valueOf( expected ), actual );
} }