Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.avsystem.scex.compiler

import com.avsystem.scex.compiler.ScexCompiler.CompilationFailedException
import com.avsystem.scex.japi.{DefaultJavaScexCompiler, JavaScexCompiler}
import org.scalatest.funsuite.AnyFunSuite

class InvalidLiteralTest extends AnyFunSuite with CompilationTest {
override protected def createCompiler: JavaScexCompiler = {
val settings = new ScexSettings
settings.classfileDirectory.value = "testClassfileCache"
//evaluating getter adapters fixes the problem (since the invalid expression isn't the first thing compiled)
settings.noGetterAdapters.value = true
new DefaultJavaScexCompiler(settings)
}

test("Invalid literal should not break the scex compiler") {
intercept[CompilationFailedException] {
evaluate[String]("11compilation_fail11")
}
evaluate[Unit]("()")
}
}