{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeApplications #-} module HUnit.Arith where import Protocol.Arith import HUnit.Utils hunit :: TestTree hunit = testGroup "Arith" [ testGroup "inv" [ testGroup "WeakParams" [ testCase "groupGen" $ inv (groupGen @WeakParams) @?= groupGen ^ (groupOrder @WeakParams + neg one) ] , testGroup "BeleniosParams" [ testCase "groupGen" $ inv (groupGen @BeleniosParams) @?= groupGen ^ (groupOrder @BeleniosParams + neg one) ] ] , testGroup "hash" [ testGroup "WeakParams" [ testCase "[groupGen]" $ hash "start" [groupGen @WeakParams] @?= F 197 , testCase "[groupGen, groupGen]" $ hash "start" [groupGen @WeakParams, groupGen] @?= F 70 ] , testGroup "BeleniosParams" [ testCase "[groupGen]" $ hash "start" [groupGen @BeleniosParams] @?= F 1115773133278002110129249165266 , testCase "[groupGen, groupGen]" $ hash "start" [groupGen @BeleniosParams, groupGen] @?= F 1237765159213600087872608890753 ] ] ]