summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/partest/scala/tools/partest/nest/Worker.scala2
-rw-r--r--test/files/scalacheck/test2.scala21
2 files changed, 22 insertions, 1 deletions
diff --git a/src/partest/scala/tools/partest/nest/Worker.scala b/src/partest/scala/tools/partest/nest/Worker.scala
index 36a07c2279..51012de66c 100644
--- a/src/partest/scala/tools/partest/nest/Worker.scala
+++ b/src/partest/scala/tools/partest/nest/Worker.scala
@@ -484,7 +484,7 @@ class Worker(val fileManager: FileManager) extends Actor {
NestUI.verbose(SFile(logFile).slurp())
// obviously this must be improved upon
succeeded =
- SFile(logFile).lines.filter(_.trim != "") forall (_ contains "OK")
+ SFile(logFile).lines.filter(_.trim != "") filter (_ contains "+") forall (_ contains "OK")
})
case "pos" =>
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
+ )
+}