Skip to content

Commit e8b1612

Browse files
committed
Fix a test.
1 parent 77ec655 commit e8b1612

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

msg.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func (e *Msg) acceptsNominatedSet() ValueSet {
128128
case e.T.NomPrepTopic != nil:
129129
return e.T.NomPrepTopic.Y
130130
}
131-
return nil // not reached
131+
return nil
132132
}
133133

134134
// Returns the set of ballots for which e votes or accepts "prepared."

msg_test.go

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,40 @@ func TestAcceptsNominated(t *testing.T) {
2929
wantA: []int{2},
3030
wantVA: []int{1, 2},
3131
},
32+
{
33+
m: &Topic{
34+
NomPrepTopic: &NomPrepTopic{
35+
NomTopic: NomTopic{X: ValueSet{valtype(1)}, Y: ValueSet{valtype(2)}},
36+
PrepTopic: PrepTopic{B: Ballot{1, valtype(1)}},
37+
},
38+
},
39+
wantA: []int{2},
40+
wantVA: []int{1, 2},
41+
},
3242
{
3343
m: &Topic{PrepTopic: &PrepTopic{B: Ballot{1, valtype(1)}}},
34-
wantA: []int{1},
35-
wantVA: []int{1},
44+
wantA: []int{},
45+
wantVA: []int{},
3646
},
3747
{
3848
m: &Topic{PrepTopic: &PrepTopic{B: Ballot{1, valtype(1)}, P: Ballot{1, valtype(2)}}},
39-
wantA: []int{1, 2},
40-
wantVA: []int{1, 2},
49+
wantA: []int{},
50+
wantVA: []int{},
4151
},
4252
{
4353
m: &Topic{PrepTopic: &PrepTopic{B: Ballot{1, valtype(1)}, P: Ballot{1, valtype(2)}, PP: Ballot{1, valtype(3)}}},
44-
wantA: []int{1, 2, 3},
45-
wantVA: []int{1, 2, 3},
54+
wantA: []int{},
55+
wantVA: []int{},
4656
},
4757
{
4858
m: &Topic{CommitTopic: &CommitTopic{B: Ballot{1, valtype(1)}}},
49-
wantA: []int{1},
50-
wantVA: []int{1},
59+
wantA: []int{},
60+
wantVA: []int{},
5161
},
5262
{
5363
m: &Topic{ExtTopic: &ExtTopic{C: Ballot{1, valtype(1)}}},
54-
wantA: []int{1},
55-
wantVA: []int{1},
64+
wantA: []int{},
65+
wantVA: []int{},
5666
},
5767
}
5868
for i, tc := range cases {

0 commit comments

Comments
 (0)