2022-12-23 13:38:34 +01:00
|
|
|
package prog8tests.codegeneration
|
|
|
|
|
|
|
|
import io.kotest.core.spec.style.FunSpec
|
|
|
|
import io.kotest.matchers.shouldNotBe
|
|
|
|
import prog8.code.target.C64Target
|
|
|
|
import prog8tests.helpers.compileText
|
|
|
|
|
|
|
|
class TestVarious: FunSpec({
|
|
|
|
test("bool to byte cast in expression is correct") {
|
|
|
|
val text="""
|
|
|
|
main {
|
|
|
|
sub start() {
|
|
|
|
ubyte[3] values
|
2023-01-31 01:14:13 +01:00
|
|
|
func(22 in values)
|
|
|
|
ubyte @shared qq = 22 in values
|
2022-12-23 13:38:34 +01:00
|
|
|
}
|
|
|
|
sub func(ubyte arg) {
|
|
|
|
arg++
|
|
|
|
}
|
|
|
|
}"""
|
|
|
|
compileText(C64Target(), false, text, writeAssembly = true) shouldNotBe null
|
|
|
|
}
|
2023-01-24 23:59:53 +01:00
|
|
|
|
2022-12-23 13:38:34 +01:00
|
|
|
})
|