diff --git a/plutus-ledger-api/test/Spec.hs b/plutus-ledger-api/test/Spec.hs index 9912e4dd537..32f623a7c8b 100644 --- a/plutus-ledger-api/test/Spec.hs +++ b/plutus-ledger-api/test/Spec.hs @@ -7,6 +7,7 @@ import Data.Either import Data.Maybe import Plutus.V1.Ledger.Api import Plutus.V1.Ledger.Examples +import qualified Spec.IntervalSpec main :: IO () main = defaultMain tests @@ -25,4 +26,5 @@ tests :: TestTree tests = testGroup "plutus-ledger-api" [ alwaysTrue , alwaysFalse + , Spec.IntervalSpec.tests ] diff --git a/plutus-ledger-api/test/Spec/IntervalSpec.hs b/plutus-ledger-api/test/Spec/IntervalSpec.hs new file mode 100644 index 00000000000..59f0cbd58d6 --- /dev/null +++ b/plutus-ledger-api/test/Spec/IntervalSpec.hs @@ -0,0 +1,22 @@ +module Spec.IntervalSpec where + +import Test.Tasty +import Test.Tasty.HUnit + +import Plutus.V1.Ledger.Interval +import Plutus.V1.Ledger.Slot + +alwaysIsNotEmpty :: TestTree +alwaysIsNotEmpty = testCase "always is not empty" $ + assertBool "always" (not $ isEmpty (always :: Interval Slot)) + +neverIsEmpty :: TestTree +neverIsEmpty = + testCase "never is empty" $ + assertBool "never" (isEmpty (never :: Interval Slot)) + +tests :: TestTree +tests = testGroup "plutus-ledger-api-interval" [ + neverIsEmpty + , alwaysIsNotEmpty + ]