restructure tests

contributes to #2
This commit is contained in:
Trolli Schmittlauch 2020-03-16 01:39:17 +01:00
parent 04b3a1f8b4
commit bfde27cea6
3 changed files with 10 additions and 14 deletions

View file

@ -106,6 +106,7 @@ test-suite Hash2Pub-test
hs-source-dirs: test
-- The entrypoint to the test suite.
main-is: MyLibTest.hs
main-is: Specs.hs
other-modules: FediChordSpec
build-depends: hspec, Hash2Pub

View file

@ -1,13 +0,0 @@
module Main (main) where
import Test.Hspec
import Hash2Pub.FediChord
main :: IO ()
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

8
Hash2Pub/test/Specs.hs Normal file
View file

@ -0,0 +1,8 @@
module Main (main) where
import Test.Hspec
import qualified FediChordSpec
main :: IO ()
main = hspec $ do
describe "FediChord tests" FediChordSpec.spec