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
import com.softwaremill.diffx.scalatest.DiffMatcher._ | |
it should "compare mikes" in { | |
Person(11, "Mike") should matchTo(Person(12, "Mike")) | |
} |
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
type Id = String @@ Person | |
implicit val dm : Diff[Id] = Diff.identical[Id] |
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
implicit val om: ObjectMatcher[Person] = new ObjectMatcher[Person] { | |
override def isSameObject(left: Person, right: Person): Boolean = { | |
left.name == right.name | |
} | |
} |
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
case class Person(age: Int, name: String) |
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
implicit def diffForLocalDate(difForString: Diff[String]): Diff[LocalDate] = | |
new Diff[LocalDate] { | |
override def apply(left: LocalDate, right: LocalDate, | |
toIgnore: List[FieldPath]): DiffResult = { | |
val formatter = DateTimeFormatter.ISO_DATE | |
difForString.apply(formatter.format(left), formatter.format(right)) | |
} | |
} |
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
case class Person(age: Int, name: String) |
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
import estrapade.{TestApp, test} | |
import magnolia.examples.Show | |
case class RPerson(age: Int, name: String, child: Option[RPerson]) | |
case class GPerson(child: Option[RPerson]) | |
object ShowDerivationTest extends TestApp { | |
implicit def showForOption[T](implicit ts: Show[String, T]): Show[String, Option[T]] = | |
new Show[String, Option[T]] { | |
override def show(value: Option[T]): String = { |
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
import estrapade.TestApp | |
import magnolia.{CaseClass, Magnolia} | |
import estrapade.{TestApp, test} | |
import contextual.data.scalac._ | |
import scala.language.experimental.macros | |
trait StructureOf[T] { | |
def structure:Structure | |
def isOptional = false | |
} |
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
import cats.data.NonEmptyList | |
import cats.effect.{ContextShift, IO, Resource, Timer} | |
import com.typesafe.scalalogging.LazyLogging | |
import io.circe.{Json, JsonObject} | |
import org.http4s.circe._ | |
import org.http4s._ | |
import org.http4s.client.Client | |
import cats.implicits._ | |
import scala.concurrent.ExecutionContext |
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
task regenerateSolc(type:Exec) { | |
inputs.dir("solidity") | |
outputs.dir("src/main/java/solidity") | |
commandLine './regenerate-solidity.sh' | |
standardOutput = new ByteArrayOutputStream() | |
ext.output = { | |
return standardOutput.toString() | |
} | |
} |