Skip to content

Commit

Permalink
Added 2 bsaic test cases for Interval.isEmpty
Browse files Browse the repository at this point in the history
  • Loading branch information
norman-thomas committed Apr 20, 2021
1 parent 3afb23e commit ff495db
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plutus-ledger-api/test/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -25,4 +26,5 @@ tests :: TestTree
tests = testGroup "plutus-ledger-api" [
alwaysTrue
, alwaysFalse
, Spec.IntervalSpec.tests
]
22 changes: 22 additions & 0 deletions plutus-ledger-api/test/Spec/IntervalSpec.hs
Original file line number Diff line number Diff line change
@@ -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
]

0 comments on commit ff495db

Please sign in to comment.