-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
sijarsu
authored and
mkrzemien
committed
Jun 7, 2020
1 parent
249a33c
commit 7026d2a
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class A() | ||
class B(val oa: Option[A]) | ||
|
||
object TestSome { | ||
val a = new A() | ||
val b = wire[B] | ||
} | ||
|
||
object TestNone { | ||
val b = wire[B] | ||
} | ||
|
||
require(TestSome.b.oa.contains(TestSome.a)) | ||
require(TestNone.b.oa.isEmpty) |
18 changes: 18 additions & 0 deletions
18
tests/src/test/scala/com/softwaremill/macwire/WireTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.softwaremill.macwire | ||
|
||
object WireTest extends App { | ||
class A() | ||
class B(val oa: Option[A]) | ||
|
||
object TestSome { | ||
val a = new A() | ||
val b = wire[B] | ||
} | ||
|
||
object TestNone { | ||
val b = wire[B] | ||
} | ||
|
||
require(TestSome.b.oa.contains(TestSome.a)) | ||
require(TestNone.b.oa.isEmpty) | ||
} |