From a4d230131638b4b26397515d98d058de4e3f4101 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Mon, 3 Apr 2017 22:16:38 -0400 Subject: be Scala 2.13 friendly for now, for the 2.13 community build. and as a start at possible future real 2.13 support --- build.sbt | 8 ++++++++ src/test/scala/spray/json/JsonParserSpec.scala | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index b03643f..2e451e0 100644 --- a/build.sbt +++ b/build.sbt @@ -26,6 +26,14 @@ libraryDependencies ++= Seq( "org.scalacheck" %% "scalacheck" % "1.13.4" % "test" ) +libraryDependencies ++= + (CrossVersion.partialVersion(scalaVersion.value) match { + case Some((2, n)) if n >= 13 => + Seq("org.scala-lang.modules" %% "scala-parallel-collections" % "0.1.1") + case _ => + Seq() + }) + (scalacOptions in doc) ++= Seq("-doc-title", name.value + " " + version.value) // generate boilerplate diff --git a/src/test/scala/spray/json/JsonParserSpec.scala b/src/test/scala/spray/json/JsonParserSpec.scala index 0f7ae7f..d7db026 100644 --- a/src/test/scala/spray/json/JsonParserSpec.scala +++ b/src/test/scala/spray/json/JsonParserSpec.scala @@ -74,7 +74,8 @@ class JsonParserSpec extends Specification { } "be reentrant" in { val largeJsonSource = scala.io.Source.fromInputStream(getClass.getResourceAsStream("/test.json")).mkString - List.fill(20)(largeJsonSource).par.map(JsonParser(_)).toList.map { + import scala.collection.parallel.immutable.ParSeq + ParSeq.fill(20)(largeJsonSource).map(JsonParser(_)).toList.map { _.asInstanceOf[JsObject].fields("questions").asInstanceOf[JsArray].elements.size } === List.fill(20)(100) } @@ -108,4 +109,4 @@ class JsonParserSpec extends Specification { |""".stripMargin } } -} \ No newline at end of file +} -- cgit v1.2.3