diff options
Diffstat (limited to 'test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala')
-rw-r--r-- | test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala b/test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala index d6b60c4351..fdfbfe871c 100644 --- a/test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala +++ b/test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala @@ -134,5 +134,14 @@ trait ValVarDeconstruction { self: QuasiquoteProperties => matches("val x: Int = 1") matches("lazy val x: Int = 1") matches("implicit val x = 1") + assertThrows[MatchError] { matches("var x = 1") } + } + + property("exhaustive var matcher") = test { + def matches(line: String) { val q"$mods var $name: $tpt = $rhs" = parse(line) } + matches("var x: Int") + matches("var x: Int = 1") + matches("var x = 1") + assertThrows[MatchError] { matches("val x = 1") } } }
\ No newline at end of file |