diff options
author | Den Shabalin <den.shabalin@gmail.com> | 2013-09-05 13:40:38 +0200 |
---|---|---|
committer | Den Shabalin <den.shabalin@gmail.com> | 2013-09-05 20:42:10 +0200 |
commit | cd07f9f9656ea1bdc6c27ef2be9192d52cd987a5 (patch) | |
tree | b01e7dabd00347b71a6ce7766747ba62cef0344b /test/files/scalacheck | |
parent | 4ad10642e9dacfb50c6c0ac0faaf7e5839bdffb5 (diff) | |
download | scala-cd07f9f9656ea1bdc6c27ef2be9192d52cd987a5.tar.gz scala-cd07f9f9656ea1bdc6c27ef2be9192d52cd987a5.tar.bz2 scala-cd07f9f9656ea1bdc6c27ef2be9192d52cd987a5.zip |
better support for ValDefs, VarDefs and DefDefs
Diffstat (limited to 'test/files/scalacheck')
-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 |