{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE OverloadedStrings #-} module HUnit.Arithmetic where import Protocol.Arithmetic import HUnit.Utils hunit :: TestTree hunit = testGroup "Arithmetic" [ testGroup "inv" [ testGroup "WeakParams" [ testCase "groupGen" $ inv (groupGen @WeakParams) @?= groupGen ^ E (groupOrder @WeakParams + neg one) ] , testGroup "BeleniosParams" [ testCase "groupGen" $ inv (groupGen @BeleniosParams) @?= groupGen ^ E (groupOrder @BeleniosParams + neg one) ] ] , testGroup "hash" [ testGroup "WeakParams" [ testCase "[groupGen]" $ hash "start" [groupGen @WeakParams] @?= inE (100::Natural) , testCase "[groupGen, groupGen]" $ hash "start" [groupGen @WeakParams, groupGen] @?= inE (16::Natural) ] , testGroup "BeleniosParams" [ testCase "[groupGen]" $ hash "start" [groupGen @BeleniosParams] @?= inE (1832875488615060263192702367259::Natural) , testCase "[groupGen, groupGen]" $ hash "start" [groupGen @BeleniosParams, groupGen] @?= inE (2495277906542783643199702546512::Natural) ] ] ]