forked from schmittlauch/Hash2Pub
implement first actual test case with hspec and run it
This commit is contained in:
parent
21fef145a0
commit
57e759836c
|
@ -1 +1 @@
|
|||
(import ./. {}).shell
|
||||
(import ./default.nix {}).shell
|
||||
|
|
|
@ -11,6 +11,7 @@ Modernised EpiChord + k-choices load balancing
|
|||
|
||||
module Hash2Pub.FediChord (
|
||||
NodeID -- abstract, but newtype constructors cannot be hidden
|
||||
, getNodeID
|
||||
, mkNodeID
|
||||
, NodeState (..)
|
||||
, CacheEntry
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
module Main (main) where
|
||||
|
||||
import qualified Hash2Pub.FediChord as FC
|
||||
import Test.Hspec
|
||||
|
||||
import Hash2Pub.FediChord
|
||||
|
||||
main :: IO ()
|
||||
main = putStrLn "Test suite not yet implemented."
|
||||
main = hspec $ do
|
||||
describe "NodeID" $ do
|
||||
it "can store a numeral ID" $ do
|
||||
getNodeID (mkNodeID 2342) `shouldBe` 2342
|
||||
it "computes ID values within the modular bounds" $ do
|
||||
getNodeID ((maxBound :: NodeID) + mkNodeID 2) < getNodeID (maxBound :: NodeID) `shouldBe` True
|
||||
|
|
Loading…
Reference in a new issue