Skip to content
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

Update scala-xml to 2.0.0 #345

Closed
wants to merge 1 commit into from
Closed
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 @@ -109,7 +109,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,16 @@ class CoberturaXmlWriterTest
val writer = new CoberturaXmlWriter(sourceRoot, dir)
writer.write(coverage)

val xml = XML.loadFile(fileIn(dir))
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))
Comment on lines +320 to +329
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needed to change in order to account for scala/scala-xml#177. I'm not super worried about this seeing that we are only using this parser to test here.


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