diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/si4750.check | 1 | ||||
-rw-r--r-- | test/files/run/si4750.scala | 7 | ||||
-rw-r--r-- | test/files/scalacheck/t2460.scala | 32 | ||||
-rw-r--r-- | test/scaladoc/scala/html/HtmlFactoryTest.scala | 15 |
4 files changed, 49 insertions, 6 deletions
diff --git a/test/files/run/si4750.check b/test/files/run/si4750.check new file mode 100644 index 0000000000..bf55f70df3 --- /dev/null +++ b/test/files/run/si4750.check @@ -0,0 +1 @@ +US$ 5.80 diff --git a/test/files/run/si4750.scala b/test/files/run/si4750.scala new file mode 100644 index 0000000000..96d2c4fec7 --- /dev/null +++ b/test/files/run/si4750.scala @@ -0,0 +1,7 @@ +import scala.util.matching.Regex + +object Test extends App { + val input = "CURRENCY 5.80" + println("CURRENCY".r.replaceAllIn(input, Regex quoteReplacement "US$")) +} + diff --git a/test/files/scalacheck/t2460.scala b/test/files/scalacheck/t2460.scala new file mode 100644 index 0000000000..196b43789f --- /dev/null +++ b/test/files/scalacheck/t2460.scala @@ -0,0 +1,32 @@ +import org.scalacheck.Prop.forAll +import org.scalacheck.Properties +import org.scalacheck.ConsoleReporter.testStatsEx +import org.scalacheck.{Test => SCTest} +import org.scalacheck.Gen + +object Test extends Properties("Regex : Ticket 2460") { + + val vowel = Gen.oneOf("a", "z") + + val numberOfMatch = forAll(vowel) { + (s: String) => "\\s*([a-z])\\s*".r("data").findAllMatchIn((1 to 20).map(_ => s).mkString).size == 20 + } + + val numberOfGroup = forAll(vowel) { + (s: String) => "\\s*([a-z])\\s*([a-z])\\s*".r("data").findAllMatchIn((1 to 20).map(_ => s).mkString).next.groupCount == 2 + } + + val nameOfGroup = forAll(vowel) { + (s: String) => "([a-z])".r("data").findAllMatchIn(s).next.group("data") == s + } + + val tests = List( + ("numberOfMatch", numberOfMatch), + ("numberOfGroup", numberOfGroup), + ("nameOfGroup", nameOfGroup) + ) + + /*tests foreach { + case (name, p) => testStatsEx(name, SCTest.check(p)) + }*/ +} diff --git a/test/scaladoc/scala/html/HtmlFactoryTest.scala b/test/scaladoc/scala/html/HtmlFactoryTest.scala index 7550faa536..28c7a4b94f 100644 --- a/test/scaladoc/scala/html/HtmlFactoryTest.scala +++ b/test/scaladoc/scala/html/HtmlFactoryTest.scala @@ -442,8 +442,9 @@ object Test extends Properties("HtmlFactory") { property("Use cases should override their original members") = checkText("SI_5054_q1.scala")( - (None,"""def test(): Int""", true), - (None,"""def test(implicit lost: Int): Int""", false) + (None,"""def test(): Int""", true) + //Disabled because the full signature is now displayed + //(None,"""def test(implicit lost: Int): Int""", false) ) property("Use cases should keep their flags - final should not be lost") = @@ -599,8 +600,9 @@ object Test extends Properties("HtmlFactory") { T StartT the type of the first argument EndT arg1 Start1 The T term comment End1 arg2 Start2 The string comment End2 - returns StartRet The return comment EndRet - Definition Classes InheritDocDerived → InheritDocBase + returns StartRet The return comment EndRet""", true), + (Some("InheritDocDerived"), + """Definition Classes InheritDocDerived → InheritDocBase Example: StartExample function[Int](3, "something") EndExample Version StartVer 0.0.2 EndVer Since StartSince 0.0.1 EndSince @@ -624,8 +626,9 @@ object Test extends Properties("HtmlFactory") { T StartT the type of the first argument EndT arg1 Start1 The T term comment End1 arg2 Start2 The string comment End2 - returns StartRet The return comment EndRet - Example: StartExample function[Int](3,"something") EndExample + returns StartRet The return comment EndRet""", true), + (Some("UseCaseInheritDoc"), + """Example: StartExample function[Int](3,"something") EndExample Version StartVer 0.0.2 EndVer Since StartSince 0.0.1 EndSince Exceptions thrown |