diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/scalacheck/quasiquotes/TermConstructionProps.scala | 14 | ||||
-rw-r--r-- | test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala | 6 |
2 files changed, 14 insertions, 6 deletions
diff --git a/test/files/scalacheck/quasiquotes/TermConstructionProps.scala b/test/files/scalacheck/quasiquotes/TermConstructionProps.scala index 74d0d54ea8..7447037399 100644 --- a/test/files/scalacheck/quasiquotes/TermConstructionProps.scala +++ b/test/files/scalacheck/quasiquotes/TermConstructionProps.scala @@ -95,12 +95,6 @@ object TermConstructionProps extends QuasiquoteProperties("term construction") { body1 ≈ body && cond1 ≈ cond } - property("unquote trees into alternative") = forAll { (c: Tree, A: Tree, B: Tree) => - q"$c match { case $A | $B => }" ≈ - Match(c, List( - CaseDef(Alternative(List(A, B)), EmptyTree, Literal(Constant(()))))) - } - def blockInvariant(quote: Tree, trees: List[Tree]) = quote ≈ (trees match { case Nil => q"{}" @@ -303,4 +297,12 @@ object TermConstructionProps extends QuasiquoteProperties("term construction") { property("SI-8385 b") = test { assertEqAst(q"(() => ())()", "(() => ())()") } + + property("match scrutinee may not be empty") = test { + assertThrows[IllegalArgumentException] { + val scrutinee = q"" + val cases = List(cq"_ =>") + q"$scrutinee match { case ..$cases }" + } + } } diff --git a/test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala b/test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala index f558a2f078..993ceea8e9 100644 --- a/test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala +++ b/test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala @@ -211,4 +211,10 @@ object TermDeconstructionProps extends QuasiquoteProperties("term deconstruction val q"$f[..$targs]" = tq"foo[bar]" } } + + property("match doesn't match partial function") = test { + assertThrows[MatchError] { + val q"$_ match { case ..$_ }" = q"{ case _ => }" + } + } } |