Giter Club home page Giter Club logo

Comments (6)

jlink avatar jlink commented on July 20, 2024 2

Just checked your sample property with the latest versions of jqwik (0.8.15 and 0.9.0-SNAPSHOT). Both seem to shrink the value correctly to 3.0 without throwing a JqwikException.

Which version of jqwik are you using? I loosely remember to have fixed a float related shrinking bug in an earlier version...

from jqwik.

jlink avatar jlink commented on July 20, 2024 1

from jqwik.

jlink avatar jlink commented on July 20, 2024

from jqwik.

gayatrihimthani avatar gayatrihimthani commented on July 20, 2024

Actual test case is quite big, below is a smaller simulation of it:

	@Property(tries = 10)
	public void testBigDecimal(@ForAll("getNum") double num) {
		assertTrue(num > 5.0);
	}
	
	@Provide
	public Arbitrary<Double> getNum() {
		return Arbitraries.doubles().between(2.4, 4.9);
	}

from jqwik.

gayatrihimthani avatar gayatrihimthani commented on July 20, 2024

Thank you so much for your answer :) and sincere apologies for the delay in my reply.
I was using 0.8.12 version earlier; tested with 0.8.15 now and it worked fine. Just a query here, shouldn't the shrunk value be '2.4' as its the min value from the set that doesn't pass the test?

from jqwik.

jlink avatar jlink commented on July 20, 2024

I was wondering about the best shrunk value in that case myself. The distance function I use will value less decimal places as "closer" to the best possible value. If you have a compelling argument why 2.4 is the better value and how to calculate a general distance function for decimal numbers that will lead to this result I'd be happy to see that raised in a new issue.

from jqwik.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.