aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJon Pretty <jon.pretty@propensive.com>2017-11-29 15:15:51 +0100
committerGitHub <noreply@github.com>2017-11-29 15:15:51 +0100
commit2332d33b0da2861e958a313bbd1707ab0ce289db (patch)
tree95498c404dce5ad93f879bbd9742b2c24a1bac84 /tests
parent192173d811f870e6e9c705c80118e27dc63a898b (diff)
parentc560260df88d597fb8858603deb233c8212163b9 (diff)
downloadmagnolia-2332d33b0da2861e958a313bbd1707ab0ce289db.tar.gz
magnolia-2332d33b0da2861e958a313bbd1707ab0ce289db.tar.bz2
magnolia-2332d33b0da2861e958a313bbd1707ab0ce289db.zip
Merge pull request #49 from missingfaktor/master
Avoid instantiating Unit when producing error stack
Diffstat (limited to 'tests')
-rw-r--r--tests/src/main/scala/tests.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/src/main/scala/tests.scala b/tests/src/main/scala/tests.scala
index e453502..cf31836 100644
--- a/tests/src/main/scala/tests.scala
+++ b/tests/src/main/scala/tests.scala
@@ -161,6 +161,16 @@ object Tests extends TestApp {
| in parameter 'alpha' of product type Beta
|"""))
+ test("not attempt to instantiate Unit when producing error stack") {
+ scalac"""
+ import magnolia.examples._
+ case class Gamma(unit: Unit)
+ Show.gen[Gamma]
+ """
+ }.assert(_ == TypecheckError(txt"""magnolia: could not find typeclass for type Unit
+ | in parameter 'unit' of product type Gamma
+ |"""))
+
test("typenames and labels are not encoded") {
implicitly[Show[String, `%%`]].show(`%%`(1, "two"))
}.assert(_ == "%%(/=1,#=two)")