-
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
Showing
23 changed files
with
47 additions
and
22 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...o/catssupport/MacwireAutoCatsMacros.scala → ...wire/autocats/MacwireAutoCatsMacros.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
4 changes: 2 additions & 2 deletions
4
...ll/macwire/auto/catssupport/package.scala → ...ftwaremill/macwire/autocats/package.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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package com.softwaremill.macwire.auto | ||
package com.softwaremill.macwire | ||
|
||
import cats.effect._ | ||
|
||
package object catssupport { | ||
package object autocats { | ||
def autowire[T](dependencies: Any*): Resource[IO, T] = macro MacwireCatsEffectMacros.autowire_impl[T] | ||
} |
2 changes: 1 addition & 1 deletion
2
macrosAutoCatsTests/src/test/resources/test-cases/factoryNoParameters.success
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
2 changes: 1 addition & 1 deletion
2
macrosAutoCatsTests/src/test/resources/test-cases/factoryWithParameter.success
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
2 changes: 1 addition & 1 deletion
2
macrosAutoCatsTests/src/test/resources/test-cases/ioProvidedParameter.success
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
2 changes: 1 addition & 1 deletion
2
macrosAutoCatsTests/src/test/resources/test-cases/resourceFactoryWithParameters.success
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
2 changes: 1 addition & 1 deletion
2
...osAutoCatsTests/src/test/resources/test-cases/resourceMultiLevelProvidedParameter.success
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
2 changes: 1 addition & 1 deletion
2
macrosAutoCatsTests/src/test/resources/test-cases/resourceProvidedParameters.success
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
2 changes: 1 addition & 1 deletion
2
macrosAutoCatsTests/src/test/resources/test-cases/simpleAutoParameters.success
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
2 changes: 1 addition & 1 deletion
2
macrosAutoCatsTests/src/test/resources/test-cases/simpleMissingDeps.failure
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
2 changes: 1 addition & 1 deletion
2
macrosAutoCatsTests/src/test/resources/test-cases/simpleMissingDepsMultiLevel.failure
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
2 changes: 1 addition & 1 deletion
2
macrosAutoCatsTests/src/test/resources/test-cases/simpleMultiLevelNoParameters.success
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
2 changes: 1 addition & 1 deletion
2
macrosAutoCatsTests/src/test/resources/test-cases/simpleMultiLevelProvidedParameter.success
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
2 changes: 1 addition & 1 deletion
2
macrosAutoCatsTests/src/test/resources/test-cases/simpleNoParameters.success
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
2 changes: 1 addition & 1 deletion
2
macrosAutoCatsTests/src/test/resources/test-cases/simpleProvidedParameter.success
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
2 changes: 1 addition & 1 deletion
2
macrosAutoCatsTests/src/test/resources/test-cases/simpleUsingCompanion.success
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
2 changes: 1 addition & 1 deletion
2
macrosAutoCatsTests/src/test/resources/test-cases/subtypeParameter.success
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
2 changes: 1 addition & 1 deletion
2
macrosAutoCatsTests/src/test/resources/test-cases/taggingParameters.success
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
25 changes: 25 additions & 0 deletions
25
macrosAutoCatsTests/src/test/resources/test-cases/todo/chainingFactoryMethods.success
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,25 @@ | ||
import com.softwaremill.macwire.autocats._ | ||
|
||
#include commonSimpleClasses | ||
import cats.effect._ | ||
|
||
|
||
val created = scala.collection.mutable.Set[String]() | ||
|
||
object Test { | ||
def theA(): Resource[IO, A] = { created.add("a"); Resource.pure(A()) } | ||
def theB(b: A): Resource[IO, B] = { created.add("b"); Resource.pure(B()) } | ||
val theC: Resource[IO, C] = autowire[C](theA _, theB _) | ||
} | ||
|
||
val theC: C = { | ||
import cats.effect.unsafe.implicits.global | ||
Test.theC.allocated.unsafeRunSync()._1 | ||
} | ||
|
||
require(theC.a != null) | ||
require(theC.b != null) | ||
|
||
require(created.size == 2) | ||
require(created.contains("a")) | ||
require(created.contains("B")) |
Empty file.
2 changes: 1 addition & 1 deletion
2
macrosAutoCatsTests/src/test/resources/test-cases/todo/factoryWithParameterFromIO.success
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
2 changes: 1 addition & 1 deletion
2
...AutoCatsTests/src/test/resources/test-cases/todo/factoryWithParameterFromResource.success
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
2 changes: 1 addition & 1 deletion
2
...cwire/auto/catssupport/CompileTests.scala → ...emill/macwire/autocats/CompileTests.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