[Native][test] Exclude FP parsing tests that require exceptions on WASM

This commit is contained in:
Pavel Punegov
2021-08-03 12:46:09 +03:00
committed by Space
parent 623b289616
commit cd487efbe9
@@ -6,6 +6,8 @@
package runtime.text.parse0 package runtime.text.parse0
import kotlin.test.* import kotlin.test.*
import kotlin.native.OsFamily
import kotlin.native.Platform
@Test @Test
fun runTest() { fun runTest() {
@@ -51,6 +53,7 @@ fun checkDouble() {
assertTrue("NaN".toDouble().isNaN(), "NaN is expected for parsing NaN") assertTrue("NaN".toDouble().isNaN(), "NaN is expected for parsing NaN")
assertTrue("-NaN".toDouble().isNaN(), "NaN is expected for parsing -NaN") assertTrue("-NaN".toDouble().isNaN(), "NaN is expected for parsing -NaN")
if (Platform.osFamily != OsFamily.WASM) {
assertFailsWith<NumberFormatException> { assertFailsWith<NumberFormatException> {
"+-5.0".toDouble() "+-5.0".toDouble()
} }
@@ -78,6 +81,7 @@ fun checkDouble() {
"NaNPICEZy".toDouble() "NaNPICEZy".toDouble()
} }
} }
}
@Test @Test
fun checkFloat() { fun checkFloat() {
@@ -103,6 +107,7 @@ fun checkFloat() {
assertTrue("NaN".toFloat().isNaN(), "NaN is expected for parsing NaN") assertTrue("NaN".toFloat().isNaN(), "NaN is expected for parsing NaN")
assertTrue("-NaN".toFloat().isNaN(), "NaN is expected for parsing -NaN") assertTrue("-NaN".toFloat().isNaN(), "NaN is expected for parsing -NaN")
if (Platform.osFamily != OsFamily.WASM) {
assertFailsWith<NumberFormatException> { assertFailsWith<NumberFormatException> {
"+-5.0f".toFloat() "+-5.0f".toFloat()
} }
@@ -137,3 +142,4 @@ fun checkFloat() {
"NaNPICEZy".toFloat() "NaNPICEZy".toFloat()
} }
} }
}