Skip to content

Commit

Permalink
Merge pull request #2214 from ceedubs/vector-monad-tests
Browse files Browse the repository at this point in the history
Check MonadTests for Vector and List
  • Loading branch information
ceedubs committed Mar 25, 2018
2 parents 7f3ea43 + a4e15ff commit f038f0c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion tests/src/test/scala/cats/tests/ListSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cats
package tests

import cats.data.{NonEmptyList, ZipList}
import cats.laws.discipline.{CommutativeApplyTests, TraverseTests, CoflatMapTests, AlternativeTests, SerializableTests, SemigroupalTests}
import cats.laws.discipline.{CommutativeApplyTests, TraverseTests, CoflatMapTests, AlternativeTests, MonadTests, SerializableTests, SemigroupalTests}
import cats.laws.discipline.arbitrary._

class ListSuite extends CatsSuite {
Expand All @@ -19,6 +19,9 @@ class ListSuite extends CatsSuite {
checkAll("List[Int] with Option", TraverseTests[List].traverse[Int, Int, Int, Set[Int], Option, Option])
checkAll("Traverse[List]", SerializableTests.serializable(Traverse[List]))

checkAll("List[Int]", MonadTests[List].monad[Int, Int, Int])
checkAll("Monad[List]", SerializableTests.serializable(Monad[List]))

checkAll("ZipList[Int]", CommutativeApplyTests[ZipList].commutativeApply[Int, Int, Int])

test("nel => list => nel returns original nel")(
Expand Down
5 changes: 4 additions & 1 deletion tests/src/test/scala/cats/tests/VectorSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cats
package tests

import cats.data.{NonEmptyVector, ZipVector}
import cats.laws.discipline.{CommutativeApplyTests, AlternativeTests, CoflatMapTests, SerializableTests, TraverseTests, SemigroupalTests}
import cats.laws.discipline.{CommutativeApplyTests, AlternativeTests, CoflatMapTests, MonadTests, SerializableTests, TraverseTests, SemigroupalTests}
import cats.laws.discipline.arbitrary._

class VectorSuite extends CatsSuite {
Expand All @@ -18,6 +18,9 @@ class VectorSuite extends CatsSuite {
checkAll("Vector[Int] with Option", TraverseTests[Vector].traverse[Int, Int, Int, Set[Int], Option, Option])
checkAll("Traverse[Vector]", SerializableTests.serializable(Traverse[Vector]))

checkAll("Vector[Int]", MonadTests[Vector].monad[Int, Int, Int])
checkAll("Monad[Vector]", SerializableTests.serializable(Monad[Vector]))

checkAll("ZipVector[Int]", CommutativeApplyTests[ZipVector].commutativeApply[Int, Int, Int])

test("show") {
Expand Down

0 comments on commit f038f0c

Please sign in to comment.