Skip to content

refined-scalacheck all values discarded #1156

@err0r500

Description

@err0r500

Hello,
I couldn't find any documentation about how to use refined-scalacheck and I struggle with refinements when they become a bit too specific (looks like they act as a filter discarding all values)

I'm new to scala and I suspect that the implicit resolution is not what it should be but I couldn't figure out how to make it work.

import org.scalacheck.Properties
import org.scalacheck.Prop.forAll

import eu.timepit.refined.auto.autoUnwrap
import eu.timepit.refined.api.Refined
import eu.timepit.refined.predicates.string.StartsWith
import eu.timepit.refined.scalacheck.string.startsWithArbitrary
import eu.timepit.refined.scalacheck.any.arbitraryFromValidate // <- my main suspect

object StringSpecification extends Properties("String") {
  property("startsWith") = forAll { (str: String Refined StartsWith["a"]) =>
    str.charAt(0).equals("a")
  }
}

// result -> String.startsWith: Gave up after only 0 passed tests. 501 tests were discarded.

Any hint about how I'm supposed to use it ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions