diff options
Diffstat (limited to 'test/files/scalacheck')
-rw-r--r-- | test/files/scalacheck/quasiquotes/PatternConstructionProps.scala | 6 | ||||
-rw-r--r-- | test/files/scalacheck/quasiquotes/PatternDeconstructionProps.scala | 5 |
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 + } } |