summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2014-02-11 16:28:02 +0100
committerEugene Burmako <xeno.by@gmail.com>2014-02-11 16:28:02 +0100
commit4f660d8c1282398655da24211f3c74af33ec8a6b (patch)
tree761eeba1c08425e4a7faae07f2ccf0c91097b03e /test/files
parentd4f5abf9002fd617e871d1f20fdcf531b38b26e1 (diff)
parentaceb0f31e84fe04244f5899f3d82630a5f56f835 (diff)
downloadscala-4f660d8c1282398655da24211f3c74af33ec8a6b.tar.gz
scala-4f660d8c1282398655da24211f3c74af33ec8a6b.tar.bz2
scala-4f660d8c1282398655da24211f3c74af33ec8a6b.zip
Merge pull request #3505 from densh/topic/pq-entry
Tweak parser entry point for pq""
Diffstat (limited to 'test/files')
-rw-r--r--test/files/scalacheck/quasiquotes/PatternConstructionProps.scala6
-rw-r--r--test/files/scalacheck/quasiquotes/PatternDeconstructionProps.scala5
2 files changed, 10 insertions, 1 deletions
diff --git a/test/files/scalacheck/quasiquotes/PatternConstructionProps.scala b/test/files/scalacheck/quasiquotes/PatternConstructionProps.scala
index 582e915258..ca4c8609ac 100644
--- a/test/files/scalacheck/quasiquotes/PatternConstructionProps.scala
+++ b/test/files/scalacheck/quasiquotes/PatternConstructionProps.scala
@@ -29,4 +29,8 @@ object PatternConstructionProps extends QuasiquoteProperties("pattern constructi
property("splice into casedef") = forAll { (pat: Tree, cond: Tree, body: Tree) =>
cq"$pat if $cond => $body" ≈ CaseDef(pat, cond, body)
}
-} \ No newline at end of file
+
+ property("splice into alternative") = forAll { (first: Tree, rest: List[Tree]) =>
+ pq"$first | ..$rest" ≈ Alternative(first :: rest)
+ }
+}
diff --git a/test/files/scalacheck/quasiquotes/PatternDeconstructionProps.scala b/test/files/scalacheck/quasiquotes/PatternDeconstructionProps.scala
index c8e66c7ef5..ad3266bcec 100644
--- a/test/files/scalacheck/quasiquotes/PatternDeconstructionProps.scala
+++ b/test/files/scalacheck/quasiquotes/PatternDeconstructionProps.scala
@@ -36,4 +36,9 @@ object PatternDeconstructionProps extends QuasiquoteProperties("pattern deconstr
val cq"$pat0 if $cond0 => $body0" = cq"$pat if $cond => $body"
pat0 ≈ pat && cond0 ≈ cond && body0 ≈ body
}
+
+ property("extract alternative") = forAll { (first: Tree, rest: List[Tree]) =>
+ val pq"$first1 | ..$rest1" = pq"$first | ..$rest"
+ first1 ≈ first && rest1 ≈ rest
+ }
}