summaryrefslogtreecommitdiff
path: root/integration/test/src/mill/integration/AmmoniteTests.scala
blob: 3f04e84df5a780cd78621344552e64679ceba79b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package mill.integration

import ammonite.ops._
import utest._

class AmmoniteTests(fork: Boolean)
  extends IntegrationTestSuite("MILL_AMMONITE_REPO", "ammonite", fork) {
  val tests = Tests{
    initWorkspace()

    def check(scalaVersion: String) = {
      val replTests = eval(
        s"amm.repl[$scalaVersion].test", "{ammonite.unit,ammonite.session.ProjectTests.guava}"
      )
      val replTestMeta = meta(s"amm.repl[$scalaVersion].test.test")
      assert(
        replTests,
        replTestMeta.contains("ammonite.session.ProjectTests.guava"),
        replTestMeta.contains("ammonite.unit.SourceTests.objectInfo.thirdPartyJava")
      )

      val compileResult = eval(
        "all", s"{shell,sshd,amm,integration}[$scalaVersion].test.compile"
      )

      assert(
        compileResult,
        ls.rec(workspacePath / 'out / 'integration / scalaVersion / 'test / 'compile)
          .exists(_.name == "ErrorTruncationTests.class")
      )
    }

    'scala2118 - check("2.11.8")
    'scala2124 - check("2.12.4")

  }
}