Skip to content

Commit 815583a

Browse files
committed
Remove ScriptUtils because scripts no longer work the same and weren't supported well anyway
1 parent 801c4c2 commit 815583a

File tree

3 files changed

+1
-70
lines changed

3 files changed

+1
-70
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A library for in-process compilation of Kotlin and Java code, in the spirit of [
1616

1717
- Compile Kotlin and Java code in tests
1818
- Test your annotation processors
19-
- Run Kotlin-script files from within your application
19+
- Test Kotlin code generation
2020

2121
## Example
2222

src/main/kotlin/com/tschuchort/compiletesting/ScriptUtils.kt

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/test/kotlin/com/tschuchort/compiletesting/KotlinCompilationTests.kt

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@ package com.tschuchort.compiletesting
22

33
import org.assertj.core.api.Assertions.assertThat
44
import com.tschuchort.compiletesting.KotlinCompilation.ExitCode
5-
import okio.Buffer
65
import org.assertj.core.api.Assertions.fail
76
import org.junit.Rule
87
import org.junit.Test
98
import org.junit.rules.TemporaryFolder
10-
import java.io.FileDescriptor
11-
import java.io.FileOutputStream
12-
import java.io.PrintStream
139
import javax.annotation.processing.AbstractProcessor
1410
import javax.annotation.processing.RoundEnvironment
1511
import javax.lang.model.element.TypeElement
@@ -591,42 +587,6 @@ class KotlinCompilationTests {
591587
assertClassLoadable(result, "${KotlinTestProcessor.GENERATED_PACKAGE}.${KotlinTestProcessor.GENERATED_JAVA_CLASS_NAME}")
592588
}
593589

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-
630590
private fun defaultCompilerConfig(): KotlinCompilation {
631591
return KotlinCompilation().apply {
632592
workingDir = temporaryFolder.root

0 commit comments

Comments
 (0)