1 {-# LANGUAGE AllowAmbiguousTypes #-}
2 {-# LANGUAGE OverloadedStrings #-}
3 module HUnit.Arithmetic where
5 import Protocol.Arithmetic
9 hunit = testGroup "Arithmetic"
11 [ testGroup "WeakParams"
12 [ testCase "groupGen" $
13 inv (groupGen @WeakParams) @?=
14 groupGen ^ E (groupOrder @WeakParams + neg one)
16 , testGroup "BeleniosParams"
17 [ testCase "groupGen" $
18 inv (groupGen @BeleniosParams) @?=
19 groupGen ^ E (groupOrder @BeleniosParams + neg one)
23 [ testGroup "WeakParams"
24 [ testCase "[groupGen]" $
25 hash "start" [groupGen @WeakParams] @?=
27 , testCase "[groupGen, groupGen]" $
28 hash "start" [groupGen @WeakParams, groupGen] @?=
31 , testGroup "BeleniosParams"
32 [ testCase "[groupGen]" $
33 hash "start" [groupGen @BeleniosParams] @?=
34 inE (1832875488615060263192702367259::Natural)
35 , testCase "[groupGen, groupGen]" $
36 hash "start" [groupGen @BeleniosParams, groupGen] @?=
37 inE (2495277906542783643199702546512::Natural)