]> Git — Sourcephile - majurity.git/blob - hjugement-protocol/test/HUnit/Election.hs
protocol: add MeasuredList.empty
[majurity.git] / hjugement-protocol / test / HUnit / Election.hs
1 {-# LANGUAGE AllowAmbiguousTypes #-}
2 {-# LANGUAGE OverloadedStrings #-}
3 module HUnit.Election where
4
5 import Prelude (Enum(..))
6 import qualified Control.Monad.Trans.State.Strict as S
7 import qualified System.Random as Random
8 import qualified Data.List as List
9
10 import Protocol.Arithmetic
11 import Protocol.Credential
12 import Protocol.Election
13 import HUnit.Utils
14
15 hunit :: TestTree
16 hunit = testGroup "Election"
17 [ testGroup "groupGenInverses" $
18 [ testCase "WeakParams" $
19 List.take 10 (groupGenInverses @WeakParams) @?=
20 [groupGen^neg (inE i) | i <- [0..9::Int]]
21 , testCase "BeleniosParams" $
22 List.take 10 (groupGenInverses @BeleniosParams) @?=
23 [groupGen^neg (inE i) | i <- [0..9::Int]]
24 ]
25 ]