-
Notifications
You must be signed in to change notification settings - Fork 190
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
Scala 2.13.0-M4 #263
Scala 2.13.0-M4 #263
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,11 +73,16 @@ class JsonParserSpec extends Specification { | |
JsonParser(json.prettyPrint.getBytes("UTF-8")) === json | ||
} | ||
"be reentrant" in { | ||
import scala.concurrent.{Await, Future} | ||
import scala.concurrent.duration._ | ||
import scala.concurrent.ExecutionContext.Implicits.global | ||
|
||
val largeJsonSource = scala.io.Source.fromInputStream(getClass.getResourceAsStream("/test.json")).mkString | ||
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) | ||
val list = Await.result( | ||
Future.traverse(List.fill(20)(largeJsonSource))(src => Future(JsonParser(src))), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good, we're not in love with the par collections anyway :) |
||
5.seconds | ||
) | ||
list.map(_.asInstanceOf[JsObject].fields("questions").asInstanceOf[JsArray].elements.size) === List.fill(20)(100) | ||
} | ||
|
||
"produce proper error messages" in { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
varargs parameter type is
collection.immutble.Seq
instead ofcollection.Seq
since Scala 2.13.0-M4