Skip to content

Commit

Permalink
Merge pull request #654 from ceedubs/to-consistency
Browse files Browse the repository at this point in the history
Tests: Xor.to and Ior.to consistency
  • Loading branch information
stew committed Nov 15, 2015
2 parents 18961d5 + d417162 commit d0f9dba
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/src/test/scala/cats/tests/IorTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,16 @@ class IorTests extends CatsSuite {
iorMaybe should === (Some(ior))
}
}

test("to consistent with toList") {
forAll { (x: Int Ior String) =>
x.to[List, String] should === (x.toList)
}
}

test("to consistent with toOption") {
forAll { (x: Int Ior String) =>
x.to[Option, String] should === (x.toOption)
}
}
}
12 changes: 12 additions & 0 deletions tests/src/test/scala/cats/tests/XorTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,16 @@ class XorTests extends CatsSuite {
}
}

test("to consistent with toList") {
forAll { (x: Int Xor String) =>
x.to[List, String] should === (x.toList)
}
}

test("to consistent with toOption") {
forAll { (x: Int Xor String) =>
x.to[Option, String] should === (x.toOption)
}
}

}

0 comments on commit d0f9dba

Please sign in to comment.