diff options
Diffstat (limited to 'tests/pending/run/t5045.scala')
-rw-r--r-- | tests/pending/run/t5045.scala | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/tests/pending/run/t5045.scala b/tests/pending/run/t5045.scala deleted file mode 100644 index 3778339aa..000000000 --- a/tests/pending/run/t5045.scala +++ /dev/null @@ -1,49 +0,0 @@ - -import scala.language.postfixOps - -object Test extends dotty.runtime.LegacyApp { - - import scala.util.matching.{ Regex, UnanchoredRegex } - - val dateP1 = """(\d\d\d\d)-(\d\d)-(\d\d)""".r.unanchored - val dateP2 = """(\d\d\d\d)-(\d\d)-(\d\d)""" r ("year", "month", "day") unanchored - val dateP3 = new Regex("""(\d\d\d\d)-(\d\d)-(\d\d)""", "year", "month", "day") with UnanchoredRegex - - val yearStr = "2011" - val dateStr = List(yearStr,"07","15").mkString("-") - - def test(msg: String)(strs: Seq[String]): Unit = println("%40s %s".format(msg, strs mkString " ")) - - test("extract an exact match") { - val dateP1(y,m,d) = dateStr - Seq(List(y,m,d).mkString("-"), dateStr) - } - - test("extract from middle of string") { - val dateP1(y,m,d) = "Tested on "+dateStr+"." - Seq(List(y,m,d).mkString("-"), dateStr) - } - - test("extract from middle of string (P2)") { - val dateP2(y,m,d) = "Tested on "+dateStr+"." - Seq(List(y,m,d).mkString("-"), dateStr) - } - - test("extract from middle of string (P3)") { - val dateP2(y,m,d) = "Tested on "+dateStr+"." - Seq(List(y,m,d).mkString("-"), dateStr) - } - - def copyright(in: String): String = in match { - case dateP1(year, month, day) => "Copyright "+year - case _ => "No copyright" - } - - test("copyright example has date") { - Seq(copyright("Date of this document: "+dateStr), "Copyright "+yearStr) - } - - test("copyright example missing date") { - Seq(copyright("Date of this document: unknown"), "No copyright") - } -} |