v1.5.5-SNAPSHOT started. compile if support
This commit is contained in:
1 parent
214f1aec9e
commit
671583638b
7 files changed
+467
-3
No files matched your search
@@ -20,9 +20,7 @@ import net.sergeych.lyng.Compiler
|
||||
import net.sergeych.lyng.Script
|
||||
import net.sergeych.lyng.Source
|
||||
import net.sergeych.lyng.resolution.SymbolOrigin
|
||||
import kotlin.test.Ignore
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
class CompileTimeResolutionSpecTest {
|
||||
@@ -83,6 +81,20 @@ class CompileTimeResolutionSpecTest {
|
||||
assertTrue(report.errors.any { it.message.contains("missingName") })
|
||||
}
|
||||
|
||||
@Test
|
||||
fun compileIfSkipsResolutionForUnselectedBranch() = runTest {
|
||||
val report = dryRun(
|
||||
"""
|
||||
compile if (defined(NoSuchClass)) {
|
||||
NoSuchClass("foo")
|
||||
} else {
|
||||
1
|
||||
}
|
||||
"""
|
||||
)
|
||||
assertTrue(report.errors.isEmpty())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun miAmbiguityIsCompileError() = runTest {
|
||||
val report = dryRun(
|
||||
|
||||
Reference in new issue
Block a user