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

add quickcheck arbitrary and some quickcheck tests #99

Merged
merged 23 commits into from
Aug 11, 2019

Conversation

maxbla
Copy link
Contributor

@maxbla maxbla commented Jul 25, 2019

Aims to fix #5. Still needs plenty of work, like supporting signed BigInts

maxbla added 4 commits July 25, 2019 03:50
#[quickcheck] attribute requires rust 1.30 or later, but quickcheck!{}
acomplishes the same thing only with more indentation.
@maxbla

This comment has been minimized.

Cargo.toml Outdated Show resolved Hide resolved
src/biguint.rs Outdated Show resolved Hide resolved
ci/test_full.sh Show resolved Hide resolved
tests/quickcheck.rs Outdated Show resolved Hide resolved
@maxbla
Copy link
Contributor Author

maxbla commented Jul 30, 2019

I think this PR is ready for review.

ci/test_full.sh Show resolved Hide resolved
src/bigint.rs Show resolved Hide resolved
src/biguint.rs Outdated Show resolved Hide resolved
src/biguint.rs Outdated Show resolved Hide resolved
src/biguint.rs Outdated Show resolved Hide resolved
tests/quickcheck.rs Outdated Show resolved Hide resolved
tests/quickcheck.rs Outdated Show resolved Hide resolved
tests/quickcheck.rs Outdated Show resolved Hide resolved
tests/quickcheck.rs Outdated Show resolved Hide resolved
tests/quickcheck.rs Outdated Show resolved Hide resolved
tests/quickcheck.rs Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
src/biguint.rs Outdated Show resolved Hide resolved
src/biguint.rs Outdated Show resolved Hide resolved
maxbla and others added 4 commits August 1, 2019 21:45
@cuviper
Copy link
Member

cuviper commented Aug 11, 2019

I tried that shift test with intentionally broken shr_round_down, and it was indeed caught!

  • always returning false:
    thread 'quicktest_shift' panicked at '[quickcheck] TEST FAILED. Arguments: (-1, 1)'
  • always returning true:
    thread 'quicktest_shift' panicked at '[quickcheck] TEST FAILED. Arguments: (1, 0)'
  • and of course, it passes with the proper shr_round_down

Thanks!

bors r+

bors bot added a commit that referenced this pull request Aug 11, 2019
99: add quickcheck arbitrary and some quickcheck tests r=cuviper a=maxbla

Aims to fix #5. Still needs plenty of work, like supporting signed `BigInts`

Co-authored-by: Max Blachman <blachmanmax@gmail.com>
@bors
Copy link
Contributor

bors bot commented Aug 11, 2019

Build succeeded

@bors bors bot merged commit edc5428 into rust-num:master Aug 11, 2019
@maxbla maxbla deleted the add-quickcheck branch August 12, 2019 04:03
ghost pushed a commit to tommilligan/multiplicative-persistence that referenced this pull request Sep 4, 2019
21: Bump num-bigint from 0.2.2 to 0.2.3 r=tommilligan a=dependabot-preview[bot]

Bumps [num-bigint](https://github.com/rust-num/num-bigint) from 0.2.2 to 0.2.3.
<details>
<summary>Changelog</summary>

*Sourced from [num-bigint's changelog](https://github.com/rust-num/num-bigint/blob/master/RELEASES.md).*

> # Release 0.2.3 (2019-09-03)
> 
> - [`Pow` is now implemented for `BigUint` exponents][77].
> - [The optional `quickcheck` feature enables implementations of `Arbitrary`][99].
> - See the [full comparison][compare-0.2.3] for performance enhancements and more!
> 
> [77]: [rust-num/num-bigint#77](https://github-redirect.dependabot.com/rust-num/num-bigint/pull/77)
> [99]: [rust-num/num-bigint#99](https://github-redirect.dependabot.com/rust-num/num-bigint/pull/99)
> [compare-0.2.3]: rust-num/num-bigint@num-bigint-0.2.2...num-bigint-0.2.3
> 
> **Contributors**: [@&#8203;cuviper](https://github.com/cuviper), [@&#8203;lcnr](https://github.com/lcnr), [@&#8203;maxbla](https://github.com/maxbla), [@&#8203;mikelodder7](https://github.com/mikelodder7), [@&#8203;mikong](https://github.com/mikong),
> [@&#8203;TheLetterTheta](https://github.com/TheLetterTheta), [@&#8203;tspiteri](https://github.com/tspiteri), [@&#8203;XAMPPRocky](https://github.com/XAMPPRocky), [@&#8203;youknowone](https://github.com/youknowone)
</details>
<details>
<summary>Commits</summary>

- [`7417458`](rust-num/num-bigint@7417458) Merge [#108](https://github-redirect.dependabot.com/rust-num/num-bigint/issues/108)
- [`e86e14b`](rust-num/num-bigint@e86e14b) Release 0.2.3
- [`f13f1e9`](rust-num/num-bigint@f13f1e9) Allow bare_trait_objects for now
- [`50f6197`](rust-num/num-bigint@50f6197) Use `?` instead of deprecated `try!`
- [`a473fe3`](rust-num/num-bigint@a473fe3) Merge [#107](https://github-redirect.dependabot.com/rust-num/num-bigint/issues/107)
- [`9430db3`](rust-num/num-bigint@9430db3) fix(bigint): Remove unused check for BigInt lcm
- [`e247980`](rust-num/num-bigint@e247980) fix(lcm): Also added fix for BigUInt
- [`500d250`](rust-num/num-bigint@500d250) fix(lcm): lcm(0,0) = 0
- [`3e34876`](rust-num/num-bigint@3e34876) Merge [#99](https://github-redirect.dependabot.com/rust-num/num-bigint/issues/99)
- [`edc5428`](rust-num/num-bigint@edc5428) switch quickchecks to using operations by reference
- Additional commits viewable in [compare view](rust-num/num-bigint@num-bigint-0.2.2...num-bigint-0.2.3)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=num-bigint&package-manager=cargo&previous-version=0.2.2&new-version=0.2.3)](https://dependabot.com/compatibility-score.html?dependency-name=num-bigint&package-manager=cargo&previous-version=0.2.2&new-version=0.2.3)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

Add optional support for quickcheck::Arbitrary
2 participants