Forgus / spock

Automatically exported from code.google.com/p/spock
0 stars 0 forks source link

OutOfMemoryErrors in EditDistance.calculateMatrix() #375

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I have a spec that has a class produce several kB of text and compares that to 
an expected result. When the spec succeeds, everything goes well, but if the 
texts differ, I get an OutOfMemoryError, even with 8 GB of heap space. Maybe, 
to prevent this from happening, there should be a string length threshold above 
which the distance is no longer calculated?
Actually I don't care about the distance anyway, I just want to see the 
differences in the report. Can I tweak the error reporter to not calculate the 
distance?

Original issue reported on code.google.com by foober...@gmail.com on 24 Sep 2014 at 7:59

GoogleCodeExporter commented 8 years ago
Thanks for the report. What exactly do you mean by "I just want to see the 
differences in the report"? To work around the problem, use `equals()` rather 
than `==`.

Original comment by pnied...@gmail.com on 24 Sep 2014 at 8:06

GoogleCodeExporter commented 8 years ago
> What exactly do you mean by "I just want to see the differences in the 
report"?

A side-by-side comparison or a unified diff output would be great, but I guess, 
the regular equality comparison report should do it too.

> To work around the problem, use `equals()` rather than `==`.

Thanks a lot!

Original comment by foober...@gmail.com on 24 Sep 2014 at 8:12

GoogleCodeExporter commented 8 years ago
Maybe you could add support for using a custom renderer - maybe via an 
annotation or a Groovy Category? Something like

use(MyCustomFailedComparisonRenderer){
  actual == expected
}

Original comment by foober...@gmail.com on 24 Sep 2014 at 8:36

GoogleCodeExporter commented 8 years ago

Original comment by pnied...@gmail.com on 1 Mar 2015 at 11:45