diff options
author | Minghao Liu <molikto@gmail.com> | 2018-01-20 02:34:52 +0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-01-19 10:34:52 -0800 |
commit | 4e6a81f65413a973223627d406564c2bf4351c1e (patch) | |
tree | ae0308d6c3878530780d6669d6dfa5047aa101cf /scalalib/src/test/scala/mill/scalalib/HelloWorldTests.scala | |
parent | a80201ad73fd9803da3a2e2d0a088766d4de4e1a (diff) | |
download | mill-4e6a81f65413a973223627d406564c2bf4351c1e.tar.gz mill-4e6a81f65413a973223627d406564c2bf4351c1e.tar.bz2 mill-4e6a81f65413a973223627d406564c2bf4351c1e.zip |
Run Main.main in current process (#115)
* no message
* fix compile
* fix compile again
* finishing in process running
* remove comment
* fix bug
* fix bug
Diffstat (limited to 'scalalib/src/test/scala/mill/scalalib/HelloWorldTests.scala')
-rw-r--r-- | scalalib/src/test/scala/mill/scalalib/HelloWorldTests.scala | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/scalalib/src/test/scala/mill/scalalib/HelloWorldTests.scala b/scalalib/src/test/scala/mill/scalalib/HelloWorldTests.scala index 70c78cee..7444604b 100644 --- a/scalalib/src/test/scala/mill/scalalib/HelloWorldTests.scala +++ b/scalalib/src/test/scala/mill/scalalib/HelloWorldTests.scala @@ -262,6 +262,30 @@ object HelloWorldTests extends TestSuite { ) } } + + 'forkRun - { + 'runIfMainClassProvided - { + val runResult = basePath / 'out / 'run / 'dest / "hello-mill" + val Right((_, evalCount)) = helloWorldWithMainEvaluator( + HelloWorldWithMain.forkRun(runResult.toString) + ) + + assert(evalCount > 0) + + + assert( + exists(runResult), + read(runResult) == "hello rockjam, your age is: 25" + ) + } + 'notRunWithoutMainClass - { + val Left(Result.Exception(err, _)) = helloWorldEvaluator(HelloWorld.forkRun()) + + assert( + err.isInstanceOf[RuntimeException] + ) + } + } 'run - { 'runIfMainClassProvided - { val runResult = basePath / 'out / 'run / 'dest / "hello-mill" |