summaryrefslogtreecommitdiff
path: root/integration/test/src/mill/integration/JawnTests.scala
blob: 21c9f133c46045e34314f24859dcff74e1e17b0c (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
package mill.integration

import ammonite.ops._
import utest._

object JawnTests extends IntegrationTestSuite("MILL_JAWN_REPO", "jawn") {
  val tests = Tests{
    initWorkspace()

    def check(scalaVersion: String) = {
      val firstCompile = eval(s"jawn[$scalaVersion].parser.test")

      assert(
        firstCompile,
        ls.rec(workspacePath).exists(_.last == "AsyncParser.class"),
        ls.rec(workspacePath).exists(_.last == "CharBuilderSpec.class")
      )

      for(scalaFile <- ls.rec(workspacePath).filter(_.ext == "scala")){
        write.append(scalaFile, "\n}")
      }

      val brokenCompile = eval(s"jawn[$scalaVersion].parser.test")

      assert(!brokenCompile)
    }

    'scala21111 - check("2.11.11")
    'scala2123 - check("2.12.3")
  }
}