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

Fix integer overflow test with Ints #58

Merged
merged 4 commits into from
Sep 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ New features:
Bugfixes:

Other improvements:
- Fix integer overflow error in test for Ints (#58 by @JordanMartinez)

## [v6.0.1](https://github.com/purescript-contrib/purescript-quickcheck-laws/releases/tag/v6.0.1) - 2021-05-06

Expand Down
5 changes: 4 additions & 1 deletion test/Test/Prim/Int.purs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module Test.Prim.Int where
import Prelude

import Effect (Effect)
import Test.QuickCheck.Gen (chooseInt)
import Test.QuickCheck.Laws (checkLaws)
import Test.QuickCheck.Laws.Data as Data
import Type.Proxy (Proxy(..))
Expand All @@ -13,7 +14,9 @@ checkInt = checkLaws "Int" do
Data.checkOrd prxInt
Data.checkCommutativeRing prxInt
Data.checkSemiring prxInt
Data.checkEuclideanRing prxInt
-- Necessary for the EuclideanRing test
-- so as to prevent integer overflow when multiplying large integer values
Data.checkEuclideanRingGen (chooseInt (-10_000) 10_000)
Data.checkRing prxInt
where
prxInt = Proxy ∷ Proxy Int