urbit-hob

Haskell utilities for phonetic base wrangling.
Log | Files | Refs | README | LICENSE

commit 53e48849b212fcb5addc7953aec3b1b41feeafc8
parent 289aa201816ebc19303628d842480d74f08354bb
Author: Jared Tobin <jared@jtobin.io>
Date:   Tue, 17 Sep 2019 08:43:50 -0230

tests: make Ob unit tests match arvo's

Diffstat:
Mtest/Ob/Tests/Unit.hs | 25++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/test/Ob/Tests/Unit.hs b/test/Ob/Tests/Unit.hs @@ -3,14 +3,29 @@ module Ob.Tests.Unit ( tests ) where +import Data.Word (Word32) import Test.Hspec import qualified Urbit.Ob.Ob as Ob tests :: Spec -tests = - describe "tail . feis" $ do +tests = do + describe "fein" $ + it "matches reference values" $ do + Ob.fein 123456789 `shouldBe` (1897766331 :: Int) + Ob.fein 15663360 `shouldBe` (1208402137 :: Int) - context "when applied to 2052065766" $ - it "should be the identity function" $ - Ob.tail (Ob.feis 2052065766) `shouldBe` 2052065766 + describe "fynd" $ + it "matches reference values" $ do + Ob.fynd 1208402137 `shouldBe` (15663360 :: Int) + Ob.fynd 1897766331 `shouldBe` (123456789 :: Int) + + describe "feis" $ + it "matches reference values" $ do + Ob.feis 123456789 `shouldBe` (2060458291 :: Word32) + Ob.feis 15663360 `shouldBe` (1195593620 :: Word32) + + describe "tail" $ + it "matches reference values" $ do + Ob.tail 123456789 `shouldBe` (1107963580 :: Word32) + Ob.tail 1195593620 `shouldBe` (15663360 :: Word32)