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