@@ -2,14 +2,10 @@ package com.tschuchort.compiletesting
2
2
3
3
import org.assertj.core.api.Assertions.assertThat
4
4
import com.tschuchort.compiletesting.KotlinCompilation.ExitCode
5
- import okio.Buffer
6
5
import org.assertj.core.api.Assertions.fail
7
6
import org.junit.Rule
8
7
import org.junit.Test
9
8
import org.junit.rules.TemporaryFolder
10
- import java.io.FileDescriptor
11
- import java.io.FileOutputStream
12
- import java.io.PrintStream
13
9
import javax.annotation.processing.AbstractProcessor
14
10
import javax.annotation.processing.RoundEnvironment
15
11
import javax.lang.model.element.TypeElement
@@ -591,42 +587,6 @@ class KotlinCompilationTests {
591
587
assertClassLoadable(result, " ${KotlinTestProcessor .GENERATED_PACKAGE } .${KotlinTestProcessor .GENERATED_JAVA_CLASS_NAME } " )
592
588
}
593
589
594
- @Test
595
- fun `Can execute Kotlinscript` () {
596
- val kSource = SourceFile .new(" Kscript.kts" , """
597
- println("hello script")
598
- """ .trimIndent())
599
-
600
- val result = defaultCompilerConfig().apply {
601
- sources = listOf (kSource)
602
- }.compile()
603
-
604
- val (ret, sysOut) = captureSystemOut {
605
- result.runCompiledScript(" Kscript" )
606
- }
607
-
608
- assertThat(sysOut).contains(" hello script" )
609
- }
610
-
611
- @Test
612
- fun `Kotlinscript receives command line arguments` () {
613
- val kSource = SourceFile .new(" Kscript.kts" , """
614
- println(args[0] + " " + args[1])
615
- """ .trimIndent())
616
-
617
- val result = defaultCompilerConfig().apply {
618
- sources = listOf (kSource)
619
- }.compile()
620
-
621
- assertThat(result.exitCode).isEqualTo(ExitCode .OK )
622
-
623
- val (_, sysOut) = captureSystemOut {
624
- result.runCompiledScript(" Kscript" , args = listOf (" arg0" , " arg1" ))
625
- }
626
-
627
- assertThat(sysOut).contains(" arg0 arg1" )
628
- }
629
-
630
590
private fun defaultCompilerConfig (): KotlinCompilation {
631
591
return KotlinCompilation ().apply {
632
592
workingDir = temporaryFolder.root
0 commit comments