summaryrefslogtreecommitdiff
path: root/test/files/scalacheck
diff options
context:
space:
mode:
authorAleksandar Pokopec <aleksandar.prokopec@epfl.ch>2010-09-27 08:17:04 +0000
committerAleksandar Pokopec <aleksandar.prokopec@epfl.ch>2010-09-27 08:17:04 +0000
commit24a9ae5a42936afc665a9059adb37f38b59b87e5 (patch)
treea47f328e0000c33060c49b1241f897a07d95d61e /test/files/scalacheck
parent82b9e235bbc2bc6c23e89729e3bc2f8d52be1c10 (diff)
downloadscala-24a9ae5a42936afc665a9059adb37f38b59b87e5.tar.gz
scala-24a9ae5a42936afc665a9059adb37f38b59b87e5.tar.bz2
scala-24a9ae5a42936afc665a9059adb37f38b59b87e5.zip
Fixes #3847. No review.
Diffstat (limited to 'test/files/scalacheck')
-rw-r--r--test/files/scalacheck/test2.scala21
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
+ )
+}