fix char range in float-range test and exclude test.p8 example from tests

This commit is contained in:
Irmen de Jong 2021-09-12 18:59:53 +02:00
parent 5145296486
commit 7241cef7a5
2 changed files with 2 additions and 4 deletions

View File

@ -75,7 +75,6 @@ class TestCompilerOnExamples {
"swirl",
"swirl-float",
"tehtriz",
"test",
"textelite",
),
dim2 = listOf(Cx16Target, C64Target),

View File

@ -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<Expression>
.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"