From 7241cef7a5d9c8ae5be3125a70503ae9c718684f Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sun, 12 Sep 2021 18:59:53 +0200 Subject: [PATCH] fix char range in float-range test and exclude test.p8 example from tests --- compiler/test/TestCompilerOnExamples.kt | 1 - compiler/test/TestCompilerOnRanges.kt | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/compiler/test/TestCompilerOnExamples.kt b/compiler/test/TestCompilerOnExamples.kt index 0caa4d08c..2fe47b74e 100644 --- a/compiler/test/TestCompilerOnExamples.kt +++ b/compiler/test/TestCompilerOnExamples.kt @@ -75,7 +75,6 @@ class TestCompilerOnExamples { "swirl", "swirl-float", "tehtriz", - "test", "textelite", ), dim2 = listOf(Cx16Target, C64Target), diff --git a/compiler/test/TestCompilerOnRanges.kt b/compiler/test/TestCompilerOnRanges.kt index 904f44012..6bc3501b1 100644 --- a/compiler/test/TestCompilerOnRanges.kt +++ b/compiler/test/TestCompilerOnRanges.kt @@ -56,14 +56,13 @@ class TestCompilerOnRanges { } @Test - @Disabled("#55: bug in ConstantIdentifierReplacer.before(VarDecl)@decl.datatype==ARRAY_F") fun testFloatArrayInitializerWithRange_char_to_char() { val platform = C64Target val result = compileText(platform, optimize = false, """ %option enable_floats main { sub start() { - float[] cs = @'a' to 'z' ; values are computed at compile time + float[] cs = 'a' to 'z' ; values are computed at compile time cs[0] = 23 ; keep optimizer from removing it } } @@ -76,7 +75,7 @@ class TestCompilerOnRanges { val rhsValues = (decl.value as ArrayLiteralValue) .value // Array .map { (it as NumericLiteralValue).number.toInt() } - val expectedStart = platform.encodeString("a", true)[0].toInt() + val expectedStart = platform.encodeString("a", false)[0].toInt() val expectedEnd = platform.encodeString("z", false)[0].toInt() val expectedStr = "$expectedStart .. $expectedEnd"