is there an easy way (preferrably using a ShouldMatcher like syntax) to
compare entire Iterable sequences for element-wise equality? Unlike
Hamcrest's "contains" (which is a "contains only these elements in
order") ScalaTest's "should contain" only checks whether the single
argument given is in the Iterable.
Best wishes,
Andreas
Can you give more details on your use case? In particular, do you want to compare Seqs with Maps or Sets? If not then you can just use equals, except for arrays.
Thanks.
Bill
----
Bill Venners
Artima, Inc.
http://www.artima.com
> --
> You received this message because you are subscribed to the Google
> Groups "scalatest-users" group.
> To post to this group, send email to scalate...@googlegroups.com
> To unsubscribe from this group, send email to
> scalatest-use...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/scalatest-users?hl=en
> ScalaTest itself, and documentation, is available here:
> http://www.artima.com/scalatest
> Can you give more details on your use case? In particular, do you want to compare Seqs with Maps or Sets? If not then you can just use equals, except for arrays.
sure. I am writing test cases for a tool that works with very large data
sets (gigabytes of garbage collection traces). At the core of tool is a
Simulation object extending Iterator[Sample] that produces said Samples
(just a bunch of metrics) from an Iterator[String], which in turn
iterates over the actual input, i.e., the trace file.
However, as I just discovered, comparing the Iterable with "should
equal" to a List of samples works just fine. I only got bitten by using
an Array previously.
So, consider this problem solved. :-)
Best wishes,
Andreas