diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-03-25 15:36:12 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-03-25 15:36:12 +0100 |
commit | 49f54abed4f82d9b58f416915edaaea889734344 (patch) | |
tree | d8ac2e0cc297210efda4753aaf13d4da8fc71f0b /test | |
parent | ec9e206c6cd364b98d31962eb9678a3c4c3dfedc (diff) | |
parent | fa91b173f7e5e64c2221d50af0684985f046637c (diff) | |
download | scala-49f54abed4f82d9b58f416915edaaea889734344.tar.gz scala-49f54abed4f82d9b58f416915edaaea889734344.tar.bz2 scala-49f54abed4f82d9b58f416915edaaea889734344.zip |
Merge pull request #3653 from densh/si/8200
SI-8200 provide an identity liftable for trees
Diffstat (limited to 'test')
-rw-r--r-- | test/files/scalacheck/quasiquotes/ErrorProps.scala | 10 | ||||
-rw-r--r-- | test/files/scalacheck/quasiquotes/LiftableProps.scala | 8 |
2 files changed, 13 insertions, 5 deletions
diff --git a/test/files/scalacheck/quasiquotes/ErrorProps.scala b/test/files/scalacheck/quasiquotes/ErrorProps.scala index 9433965935..9137fe17d8 100644 --- a/test/files/scalacheck/quasiquotes/ErrorProps.scala +++ b/test/files/scalacheck/quasiquotes/ErrorProps.scala @@ -9,9 +9,10 @@ object ErrorProps extends QuasiquoteProperties("errors") { """) property("can't unquote with given rank") = fails( - "Can't unquote List[reflect.runtime.universe.Ident], consider using ..", + "Can't unquote List[StringBuilder], consider using .. or providing an implicit instance of Liftable[List[StringBuilder]]", """ - val xs = List(q"x", q"x") + import java.lang.StringBuilder + val xs: List[StringBuilder] = Nil q"$xs" """) @@ -71,9 +72,10 @@ object ErrorProps extends QuasiquoteProperties("errors") { """) property("use ... rank or provide liftable") = fails( - "Can't unquote List[List[reflect.runtime.universe.Ident]], consider using ...", + "Can't unquote List[List[StringBuilder]], consider using ... or providing an implicit instance of Liftable[List[List[StringBuilder]]]", """ - val xs = List(List(q"x", q"x")) + import java.lang.StringBuilder + val xs: List[List[StringBuilder]] = Nil q"$xs" """) diff --git a/test/files/scalacheck/quasiquotes/LiftableProps.scala b/test/files/scalacheck/quasiquotes/LiftableProps.scala index 5d0eeb53c6..29fdea5c89 100644 --- a/test/files/scalacheck/quasiquotes/LiftableProps.scala +++ b/test/files/scalacheck/quasiquotes/LiftableProps.scala @@ -88,9 +88,10 @@ object LiftableProps extends QuasiquoteProperties("liftable") { assert(q"$const" ≈ q"0") } + val immutable = q"$scalapkg.collection.immutable" + property("lift list variants") = test { val lst = List(1, 2) - val immutable = q"$scalapkg.collection.immutable" assert(q"$lst" ≈ q"$immutable.List(1, 2)") assert(q"f(..$lst)" ≈ q"f(1, 2)") val llst = List(List(1), List(2)) @@ -98,6 +99,11 @@ object LiftableProps extends QuasiquoteProperties("liftable") { assert(q"f(...$llst)" ≈ q"f(1)(2)") } + property("lift list of tree") = test { + val lst = List(q"a", q"b") + assert(q"$lst" ≈ q"$immutable.List(a, b)") + } + property("lift tuple") = test { assert(q"${(1, 2)}" ≈ q"(1, 2)") assert(q"${(1, 2, 3)}" ≈ q"(1, 2, 3)") |