-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Added discipline tests for the new Traverse
laws
#4283
Conversation
Traverse
laws
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.
Thanks for the fast fix!
"traverse ref mapAccumulate" -> forAll(laws.mapAccumulateRef[M, A, C] _), | ||
"traverse ref mapWithIndex" -> forAll(laws.mapWithIndexRef[A, C] _), | ||
"traverse ref traverseWithIndexM" -> forAll(laws.traverseWithIndexMRef[Option, A, C] _), | ||
"traverse ref zipWithIndex" -> forAll(laws.zipWithIndexRef[A, C] _) | ||
"traverse ref zipWithIndex" -> forAll(laws.zipWithIndexRef[A, C] _), | ||
"traverse ref zipWithLongIndex" -> forAll(laws.zipWithLongIndexRef[A, C] _), | ||
"traverse ref mapWithLongIndex" -> forAll(laws.mapWithLongIndexRef[A, C] _), | ||
"traverse ref traverseWithLongIndexM" -> forAll(laws.traverseWithLongIndexMRef[Option, A, C] _), | ||
"traverse ref updated" -> forAll(laws.updatedRef[A, A](_, _, _)) |
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.
Huh, the naming of these law tests seems to be inconsistent in Cats 🤔
cats/laws/src/main/scala/cats/laws/discipline/FoldableTests.scala
Lines 60 to 67 in 83ad02b
"get reference" -> forAll(laws.getRef[A] _), | |
"fold reference" -> forAll(laws.foldRef[A] _), | |
"toList reference" -> forAll(laws.toListRef[A] _), | |
"filter_ reference" -> forAll(laws.filter_Ref[A] _), | |
"takeWhile_ reference" -> forAll(laws.takeWhile_Ref[A] _), | |
"dropWhile_ reference" -> forAll(laws.dropWhile_Ref[A] _), | |
"collectFirstSome reference" -> forAll(laws.collectFirstSome_Ref[A, B] _), | |
"collectFirst reference" -> forAll(laws.collectFirst_Ref[A, B] _), |
the boilerplate here has always annoyed me. |
Added laws tests for methods added in #4248 and #4245. @armanbilge can you take a look?