summaryrefslogtreecommitdiff
path: root/test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala
diff options
context:
space:
mode:
authorDen Shabalin <den.shabalin@gmail.com>2013-09-05 13:40:38 +0200
committerDen Shabalin <den.shabalin@gmail.com>2013-09-05 20:42:10 +0200
commitcd07f9f9656ea1bdc6c27ef2be9192d52cd987a5 (patch)
treeb01e7dabd00347b71a6ce7766747ba62cef0344b /test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala
parent4ad10642e9dacfb50c6c0ac0faaf7e5839bdffb5 (diff)
downloadscala-cd07f9f9656ea1bdc6c27ef2be9192d52cd987a5.tar.gz
scala-cd07f9f9656ea1bdc6c27ef2be9192d52cd987a5.tar.bz2
scala-cd07f9f9656ea1bdc6c27ef2be9192d52cd987a5.zip
better support for ValDefs, VarDefs and DefDefs
Diffstat (limited to 'test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala')
-rw-r--r--test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala9
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