-
Notifications
You must be signed in to change notification settings - Fork 642
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
Stats matchers #851
Comments
I have a few moments regarding details of implementation:
Problem with Double is that you can specify only 16-17 digits and other will be lost
|
I think BigDecimal is good yes, but I think we should support doubles too. Obviously there can be precision errors, but we regularly test doubles everywhere else, so I think having both options is the best way. Perhaps with your precision parameter idea. |
yep, I agree that both variants it is good idea, so lets summarize which methods we expect (for methods without explicit precision we can set up Collection<Double>.shouldHaveMean(mean: Double, precision: Int)
Collection<Double>.shouldHaveMean(mean: BigDecimal, precision: Int)
Collection<Double>.shouldHaveMean(mean: Double)
Collection<Double>.shouldHaveMean(mean: BigDecimal)
DoubleArray.shouldHaveMean(mean: Double, precision: Int)
DoubleArray.shouldHaveMean(mean: BigDecimal, precision: Int)
DoubleArray.shouldHaveMean(mean: Double)
DoubleArray.shouldHaveMean(mean: BigDecimal)
Collection<Double>.shouldHaveStandardDeviation(mean: Double, precision: Int)
Collection<Double>.shouldHaveStandardDeviation(mean: BigDecimal, precision: Int)
Collection<Double>.shouldHaveStandardDeviation(mean: Double)
Collection<Double>.shouldHaveStandardDeviation(mean: BigDecimal)
DoubleArray.shouldHaveStandardDeviation(mean: Double, precision: Int)
DoubleArray.shouldHaveStandardDeviation(mean: BigDecimal, precision: Int)
DoubleArray.shouldHaveStandardDeviation(mean: Double)
DoubleArray.shouldHaveStandardDeviation(mean: BigDecimal)
Collection<Double>.shouldHaveVariance(mean: Double, precision: Int)
Collection<Double>.shouldHaveVariance(mean: BigDecimal, precision: Int)
Collection<Double>.shouldHaveVariance(mean: Double)
Collection<Double>.shouldHaveVariance(mean: BigDecimal)
DoubleArray.shouldHaveVariance(mean: Double, precision: Int)
DoubleArray.shouldHaveVariance(mean: BigDecimal, precision: Int)
DoubleArray.shouldHaveVariance(mean: Double)
DoubleArray.shouldHaveVariance(mean: BigDecimal)
... the same for Int. support for Long, Float, BigDecimal types could be added in future by requirements. |
@alladywek are you still planning to work on this ? |
Hi @sksamuel , sorry that I am late to reply, but if it is still actual I can pick up this and finish by end of next week. |
Please do !
…On Wed, 4 Sep 2019, 09:42 Abbas Abbasov, ***@***.***> wrote:
Hi @sksamuel <https://github.com/sksamuel> , sorry that I am late to
reply, but if it is still actual I can pick up this and finish by end of
next week.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#851>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAFVSGQR2ATYQK4EK4PAKKDQH7CL5ANCNFSM4H2RWKHA>
.
|
Closed as per #989 |
Co-authored-by: Stephen Samuel <sam@sksamuel.com>
list.shouldHaveMean(123.45)
list.shouldHaveStandardDeviation(55.123)
list.shouldHaveVariance(9.4)
The text was updated successfully, but these errors were encountered: