aboutsummaryrefslogtreecommitdiff
path: root/vote/vote_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'vote/vote_test.go')
-rw-r--r--vote/vote_test.go26
1 files changed, 16 insertions, 10 deletions
diff --git a/vote/vote_test.go b/vote/vote_test.go
index 7a00ee3..6ff41b8 100644
--- a/vote/vote_test.go
+++ b/vote/vote_test.go
@@ -4,16 +4,22 @@ import (
"testing"
)
-func TestRound(t *testing.T) {
- v, e := newVoteWithRand(false, 0, nil)
+func TestVoteGeneration(t *testing.T) {
- if e != nil {
- t.Fatalf("unexpected error: %v", e)
- }
- if v.bit {
- t.Fatal("expected vote false, but got true")
- }
- if !v.VerifyProofs() {
- t.Fatalf("Proofs not correct! %+v", v)
+ for i := range 100 {
+ bit := i%3 == 1
+ vote, e := newVoteWithRand(bit, uint64(i), nil)
+
+ if e != nil {
+ t.Fatalf("unexpected error: %v", e)
+ }
+ if vote.bit != bit {
+ t.Fatalf("expected vote %t, but got %t", bit, vote.bit)
+ }
+ if !vote.VerifyProofs() {
+ t.Fatalf("Proofs not correct! %+v", vote)
+ }
+
+ t.Logf("Generated %+v\n", vote)
}
}