Implement -no-stdlib argument support in kotlin runner

#KT-43294 fixed
This commit is contained in:
Ilya Chernikov
2021-01-04 16:01:53 +01:00
parent d2ecc1e361
commit edc730f70b
2 changed files with 17 additions and 1 deletions
@@ -248,6 +248,14 @@ fun f() : Result<Int> = Result.success(42)
runProcess("kotlin", "-Xallow-result-return-type", "$testDataDirectory/funWithResultReturn.kts", expectedStdout = "42\n")
}
fun testNoStdLib() {
runProcess("kotlin", "-e", "println(42)", expectedStdout = "42\n")
runProcess(
"kotlin", "-no-stdlib", "-e", "println(42)",
expectedExitCode = 1, expectedStderrContains = Regex("error: unresolved reference: println")
)
}
fun testProperty() {
runProcess("kotlinc", "$testDataDirectory/property.kt", "-d", tmpdir.path)