elm-explorations / test

Write unit and fuzz tests for Elm code.
https://package.elm-lang.org/packages/elm-explorations/test/latest
BSD 3-Clause "New" or "Revised" License
236 stars 40 forks source link

Rename `coverage` to `distribution` #202

Closed Janiczek closed 1 year ago

Janiczek commented 1 year ago

Based on a last-minute discussion in the Incremental Elm Discord #elm-test channel and a poll in the Elm Slack #testing channel.

mpizenberg commented 1 year ago

I'm curious, why have the Distribution module (ex Coverage) be inside Test instead of inside Fuzz? is this because of some import cycle issues?

Janiczek commented 1 year ago

@mpizenberg I'd say it could live in either! I guess I put it into Test directory to be closer to the Test.fuzzWith (that's where the values will be used), but I could imagine

Test.fuzzWith
  { runs = 1000
  , distribution =
    Test.expectDistribution
      [ Fuzz.Distribution.atLeast 5 "balanced" Tree.isBalanced
     -- ^^^^
      ]
  }
  treeFuzzer
  "Assert something about trees"
  (\tree -> Expect.foo)

WDYT, does it read better, should it belong there?

mpizenberg commented 1 year ago

I asked this mostly for the purpose of API documentation. I'd expect this feature documentation to be located close to Fuzz documentation. If it better fits the documentation flow in the Test namespace, let's leave it there, and maybe add a "Fuzz" prefix as Lue suggests. If it better fits within the Fuzz module doc, maybe we move it there?

PS I haven't read the API docs of the new API so I may be totally wrong.

On Tue, Oct 11, 2022, 00:29 lue @.***> wrote:

Test.FuzzDistribution?

— Reply to this email directly, view it on GitHub https://github.com/elm-explorations/test/pull/202#issuecomment-1273873848, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAWFOCNFGVKXBOQSP5ECTMLWCSKEFANCNFSM6AAAAAARBVXMKM . You are receiving this because you were mentioned.Message ID: @.***>

Janiczek commented 1 year ago

@mpizenberg Here are the API docs (only those relevant to distribution):

Table of Contents

Screenshot 2022-10-11 at 13 12 25

Test

Screenshot 2022-10-11 at 13 11 14 Screenshot 2022-10-11 at 13 11 25 Screenshot 2022-10-11 at 13 11 32 Screenshot 2022-10-11 at 13 11 40

Test.Distribution

Screenshot 2022-10-11 at 13 12 01 Screenshot 2022-10-11 at 13 12 07 Screenshot 2022-10-11 at 13 12 10

Test.Runner

Screenshot 2022-10-11 at 13 12 16