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 testOrd #5503

Merged
merged 3 commits into from
Aug 30, 2023
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
6 changes: 4 additions & 2 deletions plutus-tx-plugin/test/StdLib/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@ testReduce = Hedgehog.property $ do
testOrd :: Property
testOrd = Hedgehog.property $ do
let gen = Gen.integral (Range.linear (-10000) 100000)
n1 <- Hedgehog.forAll $ (%) <$> gen <*> gen
n2 <- Hedgehog.forAll $ (%) <$> gen <*> gen
-- Ratio must have non-zero denominator or else an ArithException will be thrown.
gen' = Gen.filter (/= 0) gen
n1 <- Hedgehog.forAll $ (%) <$> gen <*> gen'
n2 <- Hedgehog.forAll $ (%) <$> gen <*> gen'
ghcResult <- tryHard $ n1 <= n2
plutusResult <- tryHard $ (PlutusTx.<=) (Ratio.fromGHC n1) (Ratio.fromGHC n2)
Hedgehog.annotateShow ghcResult
Expand Down
1 change: 1 addition & 0 deletions plutus-tx/src/PlutusTx/IsData/Instances.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-specialise #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# OPTIONS_GHC -ddump-splices #-}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldn't have been committed

module PlutusTx.IsData.Instances where

import PlutusTx.Bool (Bool (..))
Expand Down