Skip to content

Edge Cases and Uniqueness Revisited. Emails and Dates.

Compare
Choose a tag to compare
@jlink jlink released this 10 Feb 15:46
· 1681 commits to main since this release

New and Enhanced Features

  • Upgrade to JUnit Platform 1.7.1

  • Using @Property(edgeCases = NONE) will now also suppress the generation of
    edge cases in embedded arbitraries.

  • You now have the capability to configure an
    arbitrary's edge case generation.

  • There is a new annotation attribute @Property.whenSeedFixed and a new
    configuration parameter
    jqwik.seeds.whenfixed
    to warn or even fail when a property has been given a fixed random seed.
    See this issued for more details.
    Many thanks to osi for this contribution.

  • jqwik's approach to specify uniqueness of generated objects has been completely revamped:

    • Arbitrary.unique() and the annotation @Unique are now deprecated and will
      be removed in version 1.5.
    • Uniqueness constraints
      are now handled by the elements' container.
    • The new annotation to require uniqueness
      is called @UniqueElements and applied to the container's type.
  • Arbitraries modified through Arbitrary.unique(), which is deprecated anyway,
    no longer generate edge cases. This is actually a bug fix since the
    generated edge were not considered for uniqueness.

  • There's a new jqwik module jqwik-time
    which simplifies the generation of dates (and times in a future release).
    Many thanks to zinki97 for this contribution.

  • There's a new jqwik module jqwik-web
    which is currently home of email addresses generation.

  • Configuration parameters are now loaded via JUnit's
    Configuration Parameters mechanism.
    Parameters specified in jqwik.properties continue to work, but are considered deprecated.
    Log messages will be emitted for any used properties with their new name.
    Some parameter names have also changed.
    Many thanks to osi for this contribution.

  • Using internal Kotlin methods as properties will now produce the correct name
    as seen in the Kotlin source code.

  • The User Guide has been restructured.

  • There will now be a warning log entry when a property with more than 1 try has no
    '@forall' parameters.

  • Promoted APIs from EXPERIMENTAL to MAINTAINED

    • Mostly everything in package net.jqwik.api.lifecycle
    • Method Arbitrary.dontShrink()
    • Method Combinators.CombinableBuilder.inSetter(..)
    • Class PropertyDefaults
    • Class Reporter
    • Class SampleReportingFormat
    • Method Tuple.of()
    • Method Tuple.empty()
    • Method BigDecimalArbitrary.shrinkTowards(..)
    • Method BigIntegerArbitrary.shrinkTowards(..)
    • Method ByteArbitrary.shrinkTowards(..)
    • Method DoubleArbitrary.shrinkTowards(..)
    • Method FloatArbitrary.shrinkTowards(..)
    • Method IntegerArbitrary.shrinkTowards(..)
    • Method LongArbitrary.shrinkTowards(..)
    • Method ShortArbitrary.shrinkTowards(..)
    • Method SetArbitrary.mapEach(..)
    • Method SetArbitrary.flatMapEach(..)
    • Method ListArbitrary.mapEach(..)
    • Method ListArbitrary.flatMapEach(..)
    • Method ActionSequence.withInvariant(..)
    • Method Statistics.coverage(..)
    • Method StatisticsCollector.coverage(..)
    • Class StatisticsCoverage
    • Class StatisticsEntry

Breaking Changes

  • Arbitraries.emails() has been moved to net.jqwik.web.api.Web.emails() in new
    Web module.

  • @net.jqwik.api.constraints.Email annotation has been moved to
    @net.jqwik.web.api.Email in new
    Web module.

  • Parameters annotated with @Email will by default only generate
    "standard" email addresses.

  • Removed deprecated APIs

    • Arbitrary.samples(..)
    • Interface FalsificationResult
    • SampleReportingFormat.reportJavaBean(..)
    • Shrinkable.shrink(Falsifier<T> falsifier)
    • Interface ShrinkingSequence
    • CharacterArbitary.with(Arbitrary<Character> characterArbitrary)
    • StringArbitary.withChars(Arbitrary<Character> characterArbitrary)
  • Unconstrained wildcards are no longer handled in a special way
    but just like unconstrained type variables.

  • Arbitrary.array(..) now returns ArrayArbitrary instead of StreamableArbitrary

Bug Fixes

  • Fixed bug that could lead to strange edge case generation behaviour
    when Arbitrary.edgeCases(edgeCasesConfig) was used.