scalaprops-shapeless


License

License

Categories

Categories

Scala Languages
GroupId

GroupId

com.github.scalaprops
ArtifactId

ArtifactId

scalaprops-shapeless_sjs0.6_2.13
Last Version

Last Version

0.3.2
Release Date

Release Date

Type

Type

jar
Description

Description

scalaprops-shapeless
scalaprops-shapeless
Project URL

Project URL

https://github.com/scalaprops/scalaprops-shapeless
Project Organization

Project Organization

com.github.scalaprops
Source Code Management

Source Code Management

https://github.com/scalaprops/scalaprops-shapeless.git

Download scalaprops-shapeless_sjs0.6_2.13

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.scalaprops/scalaprops-shapeless_sjs0.6_2.13/ -->
<dependency>
    <groupId>com.github.scalaprops</groupId>
    <artifactId>scalaprops-shapeless_sjs0.6_2.13</artifactId>
    <version>0.3.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.scalaprops/scalaprops-shapeless_sjs0.6_2.13/
implementation 'com.github.scalaprops:scalaprops-shapeless_sjs0.6_2.13:0.3.2'
// https://jarcasting.com/artifacts/com.github.scalaprops/scalaprops-shapeless_sjs0.6_2.13/
implementation ("com.github.scalaprops:scalaprops-shapeless_sjs0.6_2.13:0.3.2")
'com.github.scalaprops:scalaprops-shapeless_sjs0.6_2.13:jar:0.3.2'
<dependency org="com.github.scalaprops" name="scalaprops-shapeless_sjs0.6_2.13" rev="0.3.2">
  <artifact name="scalaprops-shapeless_sjs0.6_2.13" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.scalaprops', module='scalaprops-shapeless_sjs0.6_2.13', version='0.3.2')
)
libraryDependencies += "com.github.scalaprops" % "scalaprops-shapeless_sjs0.6_2.13" % "0.3.2"
[com.github.scalaprops/scalaprops-shapeless_sjs0.6_2.13 "0.3.2"]

Dependencies

compile (4)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.13.1
org.scala-js : scalajs-library_2.13 jar 0.6.32
com.chuusai : shapeless_sjs0.6_2.13 jar 2.3.3
com.github.scalaprops : scalaprops-core_sjs0.6_2.13 jar 0.6.3

test (1)

Group / Artifact Type Version
org.scala-js : scalajs-test-bridge_2.13 jar 0.6.32

Project Modules

There are no modules declared in this project.

scalaprops-shapeless

Generation of arbitrary case classes / ADTs instances with scalaprops and shapeless ported from alexarchambault/scalacheck-shapeless.

Maven Central scaladoc Scala.js

Usage

Add to your build.sbt

libraryDependencies += "com.github.scalaprops" %% "scalaprops-shapeless" % "0.4.0"

scalaprops-shapeless depends on shapeless 2.3. It is built against scala 2.11, and 2.12.

Import the content of scalaprops.Shapeless close to where you want scalaprops.Gen type classes to be automatically available for case classes / sealed hierarchies,

import scalaprops.Shapeless._

//  If you defined:

// case class Foo(i: Int, s: String, blah: Boolean)
// case class Bar(foo: Foo, other: String)

// sealed trait Base
// case class BaseIntString(i: Int, s: String) extends Base
// case class BaseDoubleBoolean(d: Double, b: Boolean) extends Base

//  then you can now do

Gen[Foo]
Gen[Bar]
Gen[Base]

and in particular, while writing property-based tests,

val `some property about Foo` = Property.forAll {
  (foo: Foo) =>
    // Ensure foo has the required property
}

without having to define yourself a scalaprops.Gen for Foo.

Credits

scalaprops-shapeless ported from alexarchambault/scalacheck-shapeless

License

Released under the Apache 2 license. See LICENSE file for more details.

com.github.scalaprops
property based testing library for Scala

Versions

Version
0.3.2
0.3.1