From 51452964862ebfd85d50ab2ea4539b1033b16b14 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sun, 12 Sep 2021 18:53:12 +0200 Subject: [PATCH] fix test assertion for float ranges (and re-enable test) --- compiler/test/TestCompilerOnRanges.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/compiler/test/TestCompilerOnRanges.kt b/compiler/test/TestCompilerOnRanges.kt index 5f5fafdcb..904f44012 100644 --- a/compiler/test/TestCompilerOnRanges.kt +++ b/compiler/test/TestCompilerOnRanges.kt @@ -4,7 +4,6 @@ import org.junit.jupiter.api.TestInstance import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestFactory import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.BeforeAll import org.junit.jupiter.api.DynamicTest.dynamicTest import kotlin.test.* import prog8tests.helpers.* @@ -105,7 +104,6 @@ class TestCompilerOnRanges { @TestFactory - @Disabled("#55") fun floatArrayInitializerWithRange() = mapCombinations( dim1 = listOf("", "42", "41"), // sizeInDecl dim2 = listOf("%option enable_floats", ""), // optEnableFloats @@ -113,6 +111,7 @@ class TestCompilerOnRanges { dim4 = listOf(false, true), // optimize combine4 = { sizeInDecl, optEnableFloats, platform, optimize -> val displayName = + "test failed for: " + when (sizeInDecl) { "" -> "no" "42" -> "correct" @@ -130,11 +129,10 @@ class TestCompilerOnRanges { } } """) - if ((sizeInDecl == "42") && (optEnableFloats != "")){ + if (optEnableFloats != "" && (sizeInDecl=="" || sizeInDecl=="42")) result.assertSuccess() - } else { + else result.assertFailure() - } } } )