Skip to content
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

Merged
merged 1 commit into from
Aug 17, 2022

Conversation

nikololiahim
Copy link
Contributor

Added laws tests for methods added in #4248 and #4245. @armanbilge can you take a look?

@armanbilge armanbilge added this to the 2.9.0 milestone Aug 17, 2022
@armanbilge armanbilge changed the title Added laws tests for the new Traverse methods Added discipline tests for the new Traverse laws Aug 17, 2022
Copy link
Member

@armanbilge armanbilge left a 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!

Comment on lines 85 to +92
"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](_, _, _))
Copy link
Member

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 🤔

"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] _),

@johnynek
Copy link
Contributor

the boilerplate here has always annoyed me.

@armanbilge armanbilge merged commit 06f798e into typelevel:main Aug 17, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants