From 11b693c3be18e43ae58670c9c5e3c8273dc60c0e Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Wed, 11 Mar 2015 18:04:30 +0300 Subject: [PATCH] Add test on scripts with classpath --- .../integration/smoke/scriptWithClasspath/script.expected | 4 ++++ .../integration/smoke/scriptWithClasspath/script.kts | 3 +++ .../org/jetbrains/kotlin/integration/CompilerSmokeTest.java | 5 +++++ 3 files changed, 12 insertions(+) create mode 100644 compiler/testData/integration/smoke/scriptWithClasspath/script.expected create mode 100644 compiler/testData/integration/smoke/scriptWithClasspath/script.kts diff --git a/compiler/testData/integration/smoke/scriptWithClasspath/script.expected b/compiler/testData/integration/smoke/scriptWithClasspath/script.expected new file mode 100644 index 00000000000..c2dfad6f93c --- /dev/null +++ b/compiler/testData/integration/smoke/scriptWithClasspath/script.expected @@ -0,0 +1,4 @@ +OUT: +interface javax.inject.Inject + +Return code: 0 diff --git a/compiler/testData/integration/smoke/scriptWithClasspath/script.kts b/compiler/testData/integration/smoke/scriptWithClasspath/script.kts new file mode 100644 index 00000000000..9b1a132c003 --- /dev/null +++ b/compiler/testData/integration/smoke/scriptWithClasspath/script.kts @@ -0,0 +1,3 @@ +import javax.inject.Inject + +println(javaClass()) diff --git a/compiler/tests/org/jetbrains/kotlin/integration/CompilerSmokeTest.java b/compiler/tests/org/jetbrains/kotlin/integration/CompilerSmokeTest.java index de38e56c669..f51b04a143a 100644 --- a/compiler/tests/org/jetbrains/kotlin/integration/CompilerSmokeTest.java +++ b/compiler/tests/org/jetbrains/kotlin/integration/CompilerSmokeTest.java @@ -109,4 +109,9 @@ public class CompilerSmokeTest extends KotlinIntegrationTestBase { public void simpleScript() throws Exception { runCompiler("script", "-script", "script.kts", "hi", "there"); } + + @Test + public void scriptWithClasspath() throws Exception { + runCompiler("script", "-cp", new File("lib/javax.inject.jar").getAbsolutePath(), "-script", "script.kts"); + } }