Automatically add -- after script/expression in kotlin runner

#KT-37987 fixed
This commit is contained in:
Ilya Chernikov
2020-10-01 22:31:02 +02:00
parent 153217ae2e
commit d7e0649d93
3 changed files with 42 additions and 0 deletions
@@ -176,6 +176,41 @@ class LauncherScriptTest : TestCaseWithTmpdir() {
)
}
fun testCommandlineProcessing() {
runProcess(
"kotlin",
"-e",
"println(args.joinToString())",
"-a",
"b",
expectedStdout = "-a, b\n"
)
runProcess(
"kotlin",
"-e",
"println(args.joinToString())",
"--",
"-a",
"b",
expectedStdout = "-a, b\n"
)
runProcess(
"kotlin",
"$testDataDirectory/printargs.kts",
"-a",
"b",
expectedStdout = "-a, b\n"
)
runProcess(
"kotlin",
"$testDataDirectory/printargs.kts",
"--",
"-a",
"b",
expectedStdout = "-a, b\n"
)
}
fun testLegacyAssert() {
runProcess(
"kotlinc",