-
Notifications
You must be signed in to change notification settings - Fork 69
use dynamic variable to control serialization tests #141
use dynamic variable to control serialization tests #141
Conversation
* Object with a dynamic variable that allows users to skip the | ||
* serialization tests for certain instances. | ||
*/ | ||
object IsSerializable { |
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.
should we make this private[laws]
and just let people interact with this via the withoutSerialization
?
This solution looks like the best way to go forward to me. |
@johnynek Boom, done. |
It makes me cringe a bit that we solved a problem of verbosity with global mutable state :). I can't think of a practical objection as long as this is scala.js-friendly though - is |
Hmm actually couldn't this be an issue when testing an instance for something like |
@ceedubs I think the state applies in the context created inside |
@ceedubs pretty sure it's fine with I share your general cringe, but the alternative is too horrifying. Just pretend it's an implicit parameter that every function gets :) |
Sounds great! Let me know if you guys need any changes, or feel free to
|
After a four month hiatus I think this is basically fine. 👍 |
I still think this is the best solution we have to give a workaround for non-serializable types, but also check by default all the typeclasses being serializable. |
Here's a much simpler (in terms of required implementation changes and ease of use) solution to #123. To skip serialization for a block of tests, just pass a thunk to
withoutSerialization
:I think this should solve our immediate issue of making the tests reusable for non-serializable instances.