Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigDecimal arb can return edgecases outside min max limits #2834

Closed
Tracked by #2867
ciffer opened this issue Feb 17, 2022 · 4 comments
Closed
Tracked by #2867

BigDecimal arb can return edgecases outside min max limits #2834

ciffer opened this issue Feb 17, 2022 · 4 comments
Milestone

Comments

@ciffer
Copy link
Contributor

ciffer commented Feb 17, 2022

Which version of Kotest are you using
5.0.3

Arb.bigDecimal(min = .., max = ..) returns an Arbitrary that has edgecases outside of range min..max.

Reproduction:

val edgecases = Arb.bigDecimal(min = BigDecimal.ONE, max = BigDecimal.TEN)
			.edgecases()
		
println(edgecases)

Current output:

[1, 1E-300, -1E-300, -1, 0, 0.00]

Expected output:

[1]

I can provide a pull request later today if the report is accepted.

Cheers and keep up the great work!

@ciffer ciffer changed the title Bigdecimal arb can return edgecases outside min max limits BigDecimal arb can return edgecases outside min max limits Feb 17, 2022
@sksamuel
Copy link
Member

sksamuel commented Feb 17, 2022 via email

ciffer pushed a commit to ciffer/kotest that referenced this issue Feb 18, 2022
  Edgecases for Arb.bigDecimal(min, max) are now always contrained to be in range [min, max)
  Min and max are now added as edgecases for Arb.bigDecimal(min, max)
@ciffer
Copy link
Contributor Author

ciffer commented Feb 18, 2022

Created PR #2835

@ciffer
Copy link
Contributor Author

ciffer commented Feb 18, 2022

I wasn't sure what branch should I target as it isn't a fix for any specific version. Let me know if I need to change it to release/5.0.x

ciffer pushed a commit to ciffer/kotest that referenced this issue Feb 18, 2022
  Edgecases for Arb.bigDecimal(min, max) are now always contrained to be in range [min, max)
  Min is now added as edgecase for Arb.bigDecimal(min, max)
ciffer pushed a commit to ciffer/kotest that referenced this issue Feb 18, 2022
  Edgecases for Arb.bigDecimal(min, max) are now always contrained to be in range [min, max)
  Min is now added as edgecase for Arb.bigDecimal(min, max)
@sksamuel sksamuel added this to the 5.1.1 milestone Feb 21, 2022
ciffer added a commit to ciffer/kotest that referenced this issue Feb 21, 2022
  Edgecases for Arb.bigDecimal(min, max) are now always contrained to be in range [min, max)
  Min is now added as edgecase for Arb.bigDecimal(min, max)
sksamuel pushed a commit that referenced this issue Feb 21, 2022
* BigDecimal arb can return edgecases outside min max limits #2834
  Edgecases for Arb.bigDecimal(min, max) are now always contrained to be in range [min, max)
  Min is now added as edgecase for Arb.bigDecimal(min, max)

* BigDecimal arb can return edgecases outside min max limits #2834
  Edgecases for Arb.bigDecimal(min, max) are now always contrained to be in range [min, max)
  Min is now added as edgecase for Arb.bigDecimal(min, max)

Co-authored-by: kacper.lamparski <klampars@unitygroup.com>
@myuwono
Copy link
Contributor

myuwono commented Feb 22, 2022

This was fixed in #2835

@myuwono myuwono closed this as completed Feb 22, 2022
@sksamuel sksamuel modified the milestones: 5.1.1, 5.2 Mar 12, 2022
@sksamuel sksamuel mentioned this issue Mar 12, 2022
22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants