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

Make Arbitrary StreamingT more arbitrary #649

Merged
merged 1 commit into from
Nov 15, 2015

Conversation

ceedubs
Copy link
Contributor

@ceedubs ceedubs commented Nov 15, 2015

This still isn't a perfect Arbitrary instance for StreamingT, but I
think it will help us hit more test cases than the current
implementation. For example, I don't think the current instance ever
results in Wait instances.

@non could you please be one of the reviewers of this?

This still isn't a perfect Arbitrary instance for StreamingT, but I
think it will help us hit more test cases than the current
implementation. For example, I don't think the current instance ever
results in `Wait` instances.
@codecov-io
Copy link

Current coverage is 77.28%

Merging #649 into master will increase coverage by +0.09% as of a0160ef

@@            master    #649   diff @@
======================================
  Files          159     159       
  Stmts         2083    2091     +8
  Branches        70      72     +2
  Methods          0       0       
======================================
+ Hit           1608    1616     +8
  Partial          0       0       
  Missed         475     475       

Review entire Coverage Diff as of a0160ef

Powered by Codecov. Updated on successful CI builds.

@non
Copy link
Contributor

non commented Nov 15, 2015

👍

Another improvement I could imagine is using weights to try to help ensure that we have longer streams (since right now there is a 1/3 chance of being empty at each step). But let's merge this first.

@stew
Copy link
Contributor

stew commented Nov 15, 2015

👍

stew added a commit that referenced this pull request Nov 15, 2015
Make Arbitrary StreamingT more arbitrary
@stew stew merged commit 0ea6fe0 into typelevel:master Nov 15, 2015
@ceedubs ceedubs deleted the arb-streamingt branch November 15, 2015 23:38
ceedubs referenced this pull request in ceedubs/cats Nov 16, 2015
This commit does two things.

1) Use a frequency distribution in the `StreamingT` generator as
suggested by @non [here](https://github.com/non/cats/pull/649#issuecomment-156856211).
It is now twice as likely to generate a Wait as an Empty and 6 times as
likely to generate a Cons as an Empty.
2) Update the `Streaming` generator to be similar to the `StreamingT`
generator (use a frequency distribution generator of Empty, Wait, and
Cons).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants