summaryrefslogtreecommitdiff
path: root/test/files/scalacheck/quasiquotes/PatternConstructionProps.scala
diff options
context:
space:
mode:
authorDenys Shabalin <denys.shabalin@typesafe.com>2014-02-11 15:01:03 +0100
committerDenys Shabalin <denys.shabalin@typesafe.com>2014-02-11 15:12:00 +0100
commitaceb0f31e84fe04244f5899f3d82630a5f56f835 (patch)
tree761eeba1c08425e4a7faae07f2ccf0c91097b03e /test/files/scalacheck/quasiquotes/PatternConstructionProps.scala
parentd4f5abf9002fd617e871d1f20fdcf531b38b26e1 (diff)
downloadscala-aceb0f31e84fe04244f5899f3d82630a5f56f835.tar.gz
scala-aceb0f31e84fe04244f5899f3d82630a5f56f835.tar.bz2
scala-aceb0f31e84fe04244f5899f3d82630a5f56f835.zip
Tweak parser entry point for pq
Previously pq used pattern1 which required parens to be used in alternative pattern. This commit tweaks it to allow pq"a | b" syntax. Also adds some tests for alternative syntax.
Diffstat (limited to 'test/files/scalacheck/quasiquotes/PatternConstructionProps.scala')
-rw-r--r--test/files/scalacheck/quasiquotes/PatternConstructionProps.scala6
1 files changed, 5 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)
+ }
+}