diff options
author | Som Snytt <som.snytt@gmail.com> | 2013-07-08 12:26:48 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2013-07-11 19:13:32 -0700 |
commit | e7468f3a1aaae7ac4a763226f0a2b9a7a375f493 (patch) | |
tree | 9b629bee12c6049a2d62107807bfadd922c88b34 /test | |
parent | 816a444f177b5f2bb90a2e89802d06c26f6a21ff (diff) | |
download | scala-e7468f3a1aaae7ac4a763226f0a2b9a7a375f493.tar.gz scala-e7468f3a1aaae7ac4a763226f0a2b9a7a375f493.tar.bz2 scala-e7468f3a1aaae7ac4a763226f0a2b9a7a375f493.zip |
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.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/repl-paste-raw.pastie | 8 | ||||
-rw-r--r-- | test/files/run/repl-paste-raw.scala | 20 |
2 files changed, 28 insertions, 0 deletions
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" +} |