Skip to content

Commit

Permalink
Add test for Show[OneAnd]
Browse files Browse the repository at this point in the history
Adds a test for the Show instance for OneAnd
  • Loading branch information
mikejcurry committed Nov 19, 2015
1 parent fd1a45b commit 346f9f6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/src/test/scala/cats/tests/OneAndTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ class OneAndTests extends CatsSuite {
checkAll("NonEmptyList[Int]", ComonadTests[NonEmptyList].comonad[Int, Int, Int])
checkAll("Comonad[NonEmptyList[A]]", SerializableTests.serializable(Comonad[NonEmptyList]))

test("Show is not empty and is formatted as expected") {
forAll { (nel: NonEmptyList[Int]) =>
nel.show.nonEmpty should === (true)
nel.show.startsWith("OneAnd") should === (true)
nel.show should === (implicitly[Show[NonEmptyList[Int]]].show(nel))
}
}

test("Creating OneAnd + unwrap is identity") {
forAll { (i: Int, tail: List[Int]) =>
val list = i :: tail
Expand Down

0 comments on commit 346f9f6

Please sign in to comment.