diff --git a/plutus-tx-plugin/test/StdLib/Spec.hs b/plutus-tx-plugin/test/StdLib/Spec.hs index 23cbea3d22a..11d8c69d978 100644 --- a/plutus-tx-plugin/test/StdLib/Spec.hs +++ b/plutus-tx-plugin/test/StdLib/Spec.hs @@ -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 diff --git a/plutus-tx/src/PlutusTx/IsData/Instances.hs b/plutus-tx/src/PlutusTx/IsData/Instances.hs index 6a7bc38af4e..ad83bd11f41 100644 --- a/plutus-tx/src/PlutusTx/IsData/Instances.hs +++ b/plutus-tx/src/PlutusTx/IsData/Instances.hs @@ -4,6 +4,7 @@ {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-specialise #-} {-# OPTIONS_GHC -fno-warn-orphans #-} +{-# OPTIONS_GHC -ddump-splices #-} module PlutusTx.IsData.Instances where import PlutusTx.Bool (Bool (..))