diff options
author | Den Shabalin <den.shabalin@gmail.com> | 2013-12-16 17:12:29 +0100 |
---|---|---|
committer | Denys Shabalin <denys.shabalin@typesafe.com> | 2014-01-16 11:31:02 +0100 |
commit | 03e9e95f57b011336736d0e7ca64b90bb55e38a5 (patch) | |
tree | 6735441921b9aec044267794a266d7b68943ecd6 /test/files/scalacheck/quasiquotes | |
parent | 6283c01462ff37755ebd06adaa633800105ba506 (diff) | |
download | scala-03e9e95f57b011336736d0e7ca64b90bb55e38a5.tar.gz scala-03e9e95f57b011336736d0e7ca64b90bb55e38a5.tar.bz2 scala-03e9e95f57b011336736d0e7ca64b90bb55e38a5.zip |
Test edge cases of literal lifting
Previously in some corner situation proper Liftable instance
might not have been resolved.
In particular q"${true}" and q"${""}" used to fail.
Diffstat (limited to 'test/files/scalacheck/quasiquotes')
-rw-r--r-- | test/files/scalacheck/quasiquotes/LiftableProps.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/files/scalacheck/quasiquotes/LiftableProps.scala b/test/files/scalacheck/quasiquotes/LiftableProps.scala index 4fec89f191..bd631b8734 100644 --- a/test/files/scalacheck/quasiquotes/LiftableProps.scala +++ b/test/files/scalacheck/quasiquotes/LiftableProps.scala @@ -5,51 +5,62 @@ object LiftableProps extends QuasiquoteProperties("liftable") { property("splice byte") = test { val c: Byte = 0 assert(q"$c" ≈ Literal(Constant(c))) + assert(q"${0: Byte}" ≈ Literal(Constant(c))) } property("splice short") = test { val c: Short = 0 assert(q"$c" ≈ Literal(Constant(c))) + assert(q"${0: Short}" ≈ Literal(Constant(c))) } property("splice char") = test { val c: Char = 'c' assert(q"$c" ≈ Literal(Constant(c))) + assert(q"${'c'}" ≈ Literal(Constant(c))) } property("splice int") = test { val c: Int = 0 assert(q"$c" ≈ Literal(Constant(c))) + assert(q"${0: Int}" ≈ Literal(Constant(c))) } property("splice long") = test { val c: Long = 0 assert(q"$c" ≈ Literal(Constant(c))) + assert(q"${0: Long}" ≈ Literal(Constant(c))) } property("splice float") = test { val c: Float = 0.0f assert(q"$c" ≈ Literal(Constant(c))) + assert(q"${0.0f: Float}" ≈ Literal(Constant(c))) } property("splice double") = test { val c: Double = 0.0 assert(q"$c" ≈ Literal(Constant(c))) + assert(q"${0.0: Double}" ≈ Literal(Constant(c))) } property("splice boolean") = test { val c: Boolean = false assert(q"$c" ≈ Literal(Constant(c))) + assert(q"${true}" ≈ Literal(Constant(true))) + assert(q"${false}" ≈ Literal(Constant(false))) } property("splice string") = test { val c: String = "s" assert(q"$c" ≈ Literal(Constant(c))) + assert(q"${"s"}" ≈ Literal(Constant(c))) } property("splice unit") = test { val c: Unit = () assert(q"$c" ≈ Literal(Constant(c))) + assert(q"${()}" ≈ Literal(Constant(c))) } property("lift symbol") = test { |