summaryrefslogtreecommitdiff
path: root/scalalib/test/resources
diff options
context:
space:
mode:
Diffstat (limited to 'scalalib/test/resources')
-rw-r--r--scalalib/test/resources/hello-scalacheck/foo/src/Main.scala3
-rw-r--r--scalalib/test/resources/hello-scalacheck/foo/test/src/MainProps.scala21
2 files changed, 24 insertions, 0 deletions
diff --git a/scalalib/test/resources/hello-scalacheck/foo/src/Main.scala b/scalalib/test/resources/hello-scalacheck/foo/src/Main.scala
new file mode 100644
index 00000000..c98908d3
--- /dev/null
+++ b/scalalib/test/resources/hello-scalacheck/foo/src/Main.scala
@@ -0,0 +1,3 @@
+object Main extends App {
+ println("Hello world!")
+} \ No newline at end of file
diff --git a/scalalib/test/resources/hello-scalacheck/foo/test/src/MainProps.scala b/scalalib/test/resources/hello-scalacheck/foo/test/src/MainProps.scala
new file mode 100644
index 00000000..e405a965
--- /dev/null
+++ b/scalalib/test/resources/hello-scalacheck/foo/test/src/MainProps.scala
@@ -0,0 +1,21 @@
+import org.scalacheck._
+
+object MainProps extends Properties("String") {
+ import Prop.forAll
+
+ property("startsWith") = forAll { (a: String, b: String) =>
+ (a+b).startsWith(a)
+ }
+
+ property("endsWith") = forAll { (a: String, b: String) =>
+ (a+b).endsWith(b)
+ }
+
+ property("substring") = forAll { (a: String, b: String) =>
+ (a+b).substring(a.length) == b
+ }
+
+ property("substring") = forAll { (a: String, b: String, c: String) =>
+ (a+b+c).substring(a.length, a.length+b.length) == b
+ }
+} \ No newline at end of file