aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJon Pretty <jon.pretty@propensive.com>2017-11-01 11:36:14 +0100
committerJon Pretty <jon.pretty@propensive.com>2017-11-01 11:36:14 +0100
commit25fb02b13b721004269f9bd9a4e5d22c2bb219c4 (patch)
treeadeb4ff353d959dfa14e17d726b0d2f939ab2b3e /tests
parent88f36a7a552246e210266a7ae82a2e480718512e (diff)
downloadmagnolia-25fb02b13b721004269f9bd9a4e5d22c2bb219c4.tar.gz
magnolia-25fb02b13b721004269f9bd9a4e5d22c2bb219c4.tar.bz2
magnolia-25fb02b13b721004269f9bd9a4e5d22c2bb219c4.zip
Support for GADTs (including recursive ones)
Some tests still failing, but macros are working
Diffstat (limited to 'tests')
-rw-r--r--tests/src/main/scala/tests.scala22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/src/main/scala/tests.scala b/tests/src/main/scala/tests.scala
index ee3faf0..aea6cc3 100644
--- a/tests/src/main/scala/tests.scala
+++ b/tests/src/main/scala/tests.scala
@@ -23,11 +23,11 @@ object Tests extends TestApp {
Show.generic[Person].show(Person("John Smith", 34))
}.assert(_ == "Person(name=John Smith,age=34)")
- Show.generic[Tree]
+ //Show.generic[Tree[String]]
test("serialize a Branch") {
import magnolia.examples._
- implicitly[Show[String, Branch]].show(Branch(Leaf("LHS"), Leaf("RHS")))
+ implicitly[Show[String, Branch[String]]].show(Branch(Leaf("LHS"), Leaf("RHS")))
}.assert(_ == "Branch(left=Leaf(value=LHS),right=Leaf(value=RHS))")
test("test equality false") {
@@ -42,7 +42,7 @@ object Tests extends TestApp {
test("test branch equality true") {
import examples._
- Eq.generic[Tree].equal(Branch(Leaf("one"), Leaf("two")), Branch(Leaf("one"), Leaf("two")))
+ Eq.generic[Tree[String]].equal(Branch(Leaf("one"), Leaf("two")), Branch(Leaf("one"), Leaf("two")))
}.assert(_ == true)
test("construct a default value") {
@@ -52,23 +52,23 @@ object Tests extends TestApp {
test("construction of Show instance for Leaf") {
scalac"""
import magnolia.examples._
- implicitly[Show[String, Leaf]]
+ implicitly[Show[String, Leaf[String]]]
"""
- }.assert(_ == (Returns(fqt"magnolia.examples.Show[String,magnolia.examples.Leaf]"): Compilation))
+ }.assert(_ == (Returns(fqt"magnolia.examples.Show[String,magnolia.examples.Leaf[java.lang.String]]"): Compilation))
test("construction of Show instance for Tree") {
scalac"""
import magnolia.examples._
- implicitly[Show[String, Tree]]
+ implicitly[Show[String, Tree[String]]]
"""
- }.assert(_ == (Returns(fqt"magnolia.examples.Show[String,magnolia.examples.Tree]"): Compilation))
+ }.assert(_ == (Returns(fqt"magnolia.examples.Show[String,magnolia.examples.Tree[String]]"): Compilation))
test("serialize a Leaf") {
- implicitly[Show[String, Leaf]].show(Leaf("testing"))
+ implicitly[Show[String, Leaf[String]]].show(Leaf("testing"))
}.assert(_ == "Leaf(value=testing)")
test("serialize a Branch as a Tree") {
- implicitly[Show[String, Tree]].show(Branch(Leaf("LHS"), Leaf("RHS")))
+ implicitly[Show[String, Tree[String]]].show(Branch(Leaf("LHS"), Leaf("RHS")))
}.assert(_ == "Branch(left=Leaf(value=LHS),right=Leaf(value=RHS))")
test("show error stack") {
@@ -84,8 +84,8 @@ object Tests extends TestApp {
|"""): Compilation))
//test("construct a decoder") {
- //Decoder.generic[Tree].decode("string")
- //}.assert(_ == (Leaf("something"): Tree))
+ //Decoder.generic[Tree[String]].decode("string")
+ //}.assert(_ == (Leaf("something"): Tree[String]))
}
}