-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make boilerplate syntax classes extend Serializable
Today I ran into a serializability issue when using `mapN` in a Spark environment 😬.
- Loading branch information
Showing
3 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
tests/src/test/scala/cats/tests/SyntaxSerializationSuite.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package cats.tests | ||
|
||
import cats.laws.discipline.SerializableTests | ||
|
||
/** | ||
* Test that our syntax implicits are serializable. | ||
*/ | ||
class SyntaxSerializationSuite extends CatsSuite { | ||
checkAll( | ||
"Tuple3SemigroupalOps[Option, Boolean, Int, Long]", | ||
SerializableTests.serializable( | ||
cats.syntax.all.catsSyntaxTuple3Semigroupal[Option, Boolean, Int, Long]((None, None, None)) | ||
) | ||
) | ||
|
||
checkAll("SemigroupalOps[Option, Int]", | ||
SerializableTests.serializable(cats.syntax.all.catsSyntaxSemigroupal[Option, Int](None))) | ||
|
||
checkAll( | ||
"Tuple3ParallelOps[Option, Boolean, Int, Long]", | ||
SerializableTests.serializable( | ||
cats.syntax.all.catsSyntaxTuple3Parallel[Either[String, ?], Boolean, Int, Long]((Left("a"), Left("b"), Left("c"))) | ||
) | ||
) | ||
} |