diff options
author | Aleksandar Pokopec <aleksandar.prokopec@epfl.ch> | 2010-09-27 08:17:04 +0000 |
---|---|---|
committer | Aleksandar Pokopec <aleksandar.prokopec@epfl.ch> | 2010-09-27 08:17:04 +0000 |
commit | 24a9ae5a42936afc665a9059adb37f38b59b87e5 (patch) | |
tree | a47f328e0000c33060c49b1241f897a07d95d61e /test/files/scalacheck/test2.scala | |
parent | 82b9e235bbc2bc6c23e89729e3bc2f8d52be1c10 (diff) | |
download | scala-24a9ae5a42936afc665a9059adb37f38b59b87e5.tar.gz scala-24a9ae5a42936afc665a9059adb37f38b59b87e5.tar.bz2 scala-24a9ae5a42936afc665a9059adb37f38b59b87e5.zip |
Fixes #3847. No review.
Diffstat (limited to 'test/files/scalacheck/test2.scala')
-rw-r--r-- | test/files/scalacheck/test2.scala | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/files/scalacheck/test2.scala b/test/files/scalacheck/test2.scala new file mode 100644 index 0000000000..2cb5fc0498 --- /dev/null +++ b/test/files/scalacheck/test2.scala @@ -0,0 +1,21 @@ +import org.scalacheck._ + + +object Test extends Properties("String") { + property("startsWith") = Prop.forAll((a: String, b: String) => (a+b).startsWith(a)) + + property("endsWith") = Prop.forAll((a: String, b: String) => (a+b).endsWith(b)) + + // Is this really always true? + property("concat") = Prop.forAll((a: String, b: String) => + (a+b).length > a.length && (a+b).length > b.length + ) + + property("substring") = Prop.forAll((a: String, b: String) => + (a+b).substring(a.length) == b + ) + + property("substring") = Prop.forAll((a: String, b: String, c: String) => + (a+b+c).substring(a.length, a.length+b.length) == b + ) +} |