summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDen Shabalin <den.shabalin@gmail.com>2013-08-29 17:52:02 +0200
committerDen Shabalin <den.shabalin@gmail.com>2013-09-05 14:39:07 +0200
commitf9d5e3d4e8cca61ee75072ab13c2935061a1850e (patch)
treec96fe138c69a5d49f9485a1424b9b72b41282c65 /test
parentc637cfc01cb8258d47094fc79313a76bfdd5d268 (diff)
downloadscala-f9d5e3d4e8cca61ee75072ab13c2935061a1850e.tar.gz
scala-f9d5e3d4e8cca61ee75072ab13c2935061a1850e.tar.bz2
scala-f9d5e3d4e8cca61ee75072ab13c2935061a1850e.zip
SI-7196 add support for refineStat splicing and extraction
Diffstat (limited to 'test')
-rw-r--r--test/files/scalacheck/quasiquotes/TypeConstructionProps.scala5
-rw-r--r--test/files/scalacheck/quasiquotes/TypeDeconstructionProps.scala5
2 files changed, 10 insertions, 0 deletions
diff --git a/test/files/scalacheck/quasiquotes/TypeConstructionProps.scala b/test/files/scalacheck/quasiquotes/TypeConstructionProps.scala
index 535ed8ecbf..459d733733 100644
--- a/test/files/scalacheck/quasiquotes/TypeConstructionProps.scala
+++ b/test/files/scalacheck/quasiquotes/TypeConstructionProps.scala
@@ -22,4 +22,9 @@ object TypeConstructionProps extends QuasiquoteProperties("type construction")
assert(tq"(..$ts)" ≈ tq"Tuple2[t1, t2]")
assert(tq"(t0, ..$ts)" ≈ tq"Tuple3[t0, t1, t2]")
}
+
+ property("refined type") = test {
+ val stats = q"def foo" :: q"val x: Int" :: q"type Y = String" :: Nil
+ assert(tq"T { ..$stats }" ≈ tq"T { def foo; val x: Int; type Y = String }")
+ }
} \ No newline at end of file
diff --git a/test/files/scalacheck/quasiquotes/TypeDeconstructionProps.scala b/test/files/scalacheck/quasiquotes/TypeDeconstructionProps.scala
index 6ab699d4f0..5c919e55cb 100644
--- a/test/files/scalacheck/quasiquotes/TypeDeconstructionProps.scala
+++ b/test/files/scalacheck/quasiquotes/TypeDeconstructionProps.scala
@@ -26,4 +26,9 @@ object TypeDeconstructionProps extends QuasiquoteProperties("type deconstruction
val tq"($head, ..$tail)" = tq"(t0, t1, t2)"
assert(head ≈ tq"t0" && tail ≈ List(tq"t1", tq"t2"))
}
+
+ property("refined type") = test {
+ val tq"T { ..$stats }" = tq"T { def foo; val x: Int; type Y = String }"
+ assert(stats ≈ (q"def foo" :: q"val x: Int" :: q"type Y = String" :: Nil))
+ }
} \ No newline at end of file