aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/xyz/driver/core/CoreTest.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/scala/xyz/driver/core/CoreTest.scala')
-rw-r--r--src/test/scala/xyz/driver/core/CoreTest.scala9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/test/scala/xyz/driver/core/CoreTest.scala b/src/test/scala/xyz/driver/core/CoreTest.scala
index 520fe8e..ded0c8d 100644
--- a/src/test/scala/xyz/driver/core/CoreTest.scala
+++ b/src/test/scala/xyz/driver/core/CoreTest.scala
@@ -47,15 +47,20 @@ class CoreTest extends FlatSpec with Matchers with MockitoSugar {
implicit val xy = Id.Mapper[X, Y]
implicit val yz = Id.Mapper[Y, Z]
- // The real test is that the following statements compile:
+ // Test that implicit conversions work correctly
val x = X(Id("0"))
val y = Y(x.id)
val z = Z(y.id)
val y2 = Y(z.id)
val x2 = X(y2.id)
-
(x2 === x) should be(true)
(y2 === y) should be(true)
+
+ // Test that type inferrence for explicit conversions work correctly
+ val yid = y.id
+ val xid = xy(yid)
+ val zid = yz(yid)
+ (xid: Id[X]) should be(zid: Id[Z])
}
"Time" should "use TimeZone correctly when converting to Date" in {