|
Scala example source code file (CaseInsensitiveTest.scala)
The CaseInsensitiveTest.scala Scala example source code
package scalaz
import std.AllInstances._
import scalaz.scalacheck.ScalazProperties._
import scalaz.scalacheck.ScalazArbitrary._
import org.scalacheck.Prop.forAll
object CaseInsensitiveTest extends SpecLite {
"map identity" ! forAll {
(a: CaseInsensitive[String]) =>
Equal[CaseInsensitive[String]].equal(a.map(x => x), a)
}
"map associativity" ! forAll {
(a: CaseInsensitive[String], f: String => String, g: String => String) =>
Equal[CaseInsensitive[String]].equal(a.map(f).map(g), a.map(g compose f))
}
checkAll(monoid.laws[CaseInsensitive[String]])
checkAll(equal.laws[CaseInsensitive[String]])
checkAll(order.laws[CaseInsensitive[String]])
}
Other Scala examples (source code examples)Here is a short list of links related to this Scala CaseInsensitiveTest.scala source code file: |
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.