Skip to content

Bump version of scala-xml to 2.0.0 #384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ lazy val plugin =
crossTarget := target.value / s"scala-${scalaVersion.value}",
crossVersion := CrossVersion.full,
libraryDependencies ++= Seq(
"org.scala-lang.modules" %% "scala-xml" % "1.3.0",
"org.scala-lang.modules" %% "scala-xml" % "2.0.0",
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
"org.scala-lang" % "scala-compiler" % scalaVersion.value % Provided
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ package scoverage
import java.io.File
import java.util.UUID
import javax.xml.parsers.DocumentBuilderFactory
import javax.xml.parsers.SAXParserFactory

import scala.xml.Elem
import scala.xml.XML
import scala.xml.factory.XMLLoader

import org.scalatest.BeforeAndAfter
import org.scalatest.OneInstancePerTest
Expand Down Expand Up @@ -314,7 +317,17 @@ class CoberturaXmlWriterTest
val writer = new CoberturaXmlWriter(sourceRoot, dir)
writer.write(coverage)

val xml = XML.loadFile(fileIn(dir))
// Needed to acount for https://github.com/scala/scala-xml/pull/177
val customXML: XMLLoader[Elem] = XML.withSAXParser {
val factory = SAXParserFactory.newInstance()
factory.setFeature(
"http://apache.org/xml/features/nonvalidating/load-external-dtd",
false
)
factory.newSAXParser()
}

val xml = customXML.loadFile(fileIn(dir))

assert((xml \\ "coverage" \ "@line-rate").text === "0.33", "line-rate")
assert((xml \\ "coverage" \ "@branch-rate").text === "0.50", "branch-rate")
Expand Down