From e7468f3a1aaae7ac4a763226f0a2b9a7a375f493 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Mon, 8 Jul 2013 12:26:48 -0700 Subject: SI-4684 Repl supports raw paste By special request, :paste -raw simply compiles the pasted code to the repl output dir. The -raw flag means no wrapping; the pasted code must be ordinary top level Scala code, not script. --- test/files/run/repl-paste-raw.pastie | 8 ++++++++ test/files/run/repl-paste-raw.scala | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 test/files/run/repl-paste-raw.pastie create mode 100644 test/files/run/repl-paste-raw.scala (limited to 'test') diff --git a/test/files/run/repl-paste-raw.pastie b/test/files/run/repl-paste-raw.pastie new file mode 100644 index 0000000000..f13b4bcf8b --- /dev/null +++ b/test/files/run/repl-paste-raw.pastie @@ -0,0 +1,8 @@ + +// a raw paste is not a script +// hence it can be packaged + +package brown_paper + +// these are a few of my favorite things +case class Gift (hasString: Boolean) diff --git a/test/files/run/repl-paste-raw.scala b/test/files/run/repl-paste-raw.scala new file mode 100644 index 0000000000..2953796f99 --- /dev/null +++ b/test/files/run/repl-paste-raw.scala @@ -0,0 +1,20 @@ + +import scala.tools.partest.SessionTest + +object Test extends SessionTest { + def session = +s"""|Type in expressions to have them evaluated. + |Type :help for more information. + | + |scala> :paste -raw $pastie + |Pasting file $pastie... + | + |scala> val favoriteThing = brown_paper.Gift(true) + |favoriteThing: brown_paper.Gift = Gift(true) + | + |scala> favoriteThing.hasString + |res0: Boolean = true + | + |scala> """ + def pastie = testPath changeExtension "pastie" +} -- cgit v1.2.3