Skip to content

Commit

Permalink
Updated test to verify that the head of OneAnd is in the Show result,…
Browse files Browse the repository at this point in the history
… and an additional check that verifies an exact String result
  • Loading branch information
mikejcurry committed Nov 20, 2015
1 parent 346f9f6 commit 0a2ac48
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/src/test/scala/cats/tests/OneAndTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,17 @@ class OneAndTests extends CatsSuite {
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.startsWith("OneAnd(") should === (true)
nel.show should === (implicitly[Show[NonEmptyList[Int]]].show(nel))
nel.show.contains(nel.head.show) should === (true)
}
}

test("Show is formatted correctly") {
val oneAnd = NonEmptyList("Test", Nil)
oneAnd.show should === ("OneAnd(Test, List())")
}

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

0 comments on commit 0a2ac48

Please sign in to comment.