|
Scala example source code file (StringTest.scala)
The StringTest.scala Scala example source code
package scalaz
package std
import std.AllInstances._
import scalaz.scalacheck.ScalazProperties._
object StringTest extends SpecLite {
checkAll(monoid.laws[String])
checkAll(isEmpty.laws[λ[α => String]])
checkAll(order.laws[String].withProp("benchmark", order.scalaOrdering[String]))
"parseBoolean" in {
import string.parseBoolean
implicit val s = Show.showFromToString[IllegalArgumentException]
implicit val e = Equal.equalA[IllegalArgumentException]
parseBoolean("true") must_===(Validation.success(true))
parseBoolean("false") must_===(Validation.success(false))
parseBoolean("1").isSuccess must_===(false)
}
}
Other Scala examples (source code examples)Here is a short list of links related to this Scala StringTest.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.