Skip to content

Commit ea40b0d

Browse files
committed
using 'ID' instead of 'Str' or 'String' in the names of constants and methods
1 parent b35200d commit ea40b0d

File tree

2 files changed

+99
-99
lines changed

2 files changed

+99
-99
lines changed

contracts/evoting/types/ballots.go

+17-17
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import (
1111
)
1212

1313
const (
14-
selectStr = "select"
15-
rankStr = "rank"
16-
textStr = "text"
14+
selectID = "select"
15+
rankID = "rank"
16+
textID = "text"
1717
)
1818

1919
// Ballot contains all information about a simple ballot
@@ -87,7 +87,7 @@ func (b *Ballot) Unmarshal(marshalledBallot string, election Election) error {
8787

8888
switch question[0] {
8989

90-
case selectStr:
90+
case selectID:
9191
selections := strings.Split(question[2], ",")
9292

9393
selectQ := Select{
@@ -106,7 +106,7 @@ func (b *Ballot) Unmarshal(marshalledBallot string, election Election) error {
106106
b.SelectResultIDs = append(b.SelectResultIDs, ID(questionID))
107107
b.SelectResult = append(b.SelectResult, results)
108108

109-
case rankStr:
109+
case rankID:
110110
ranks := strings.Split(question[2], ",")
111111

112112
rankQ := Rank{
@@ -124,7 +124,7 @@ func (b *Ballot) Unmarshal(marshalledBallot string, election Election) error {
124124
b.RankResultIDs = append(b.RankResultIDs, ID(questionID))
125125
b.RankResult = append(b.RankResult, results)
126126

127-
case textStr:
127+
case textID:
128128
texts := strings.Split(question[2], ",")
129129

130130
textQ := Text{
@@ -317,21 +317,21 @@ func (s *Subject) MaxEncodedSize() int {
317317

318318
//TODO : optimise by computing max size according to number of choices and maxN
319319
for _, rank := range s.Ranks {
320-
size += len(rank.GetString() + "::")
320+
size += len(rank.GetID() + "::")
321321
size += len(rank.ID)
322322
// at most 3 bytes (128) + ',' per choice
323323
size += len(rank.Choices) * 4
324324
}
325325

326326
for _, selection := range s.Selects {
327-
size += len(selection.GetString() + "::")
327+
size += len(selection.GetID() + "::")
328328
size += len(selection.ID)
329329
// 1 bytes (0/1) + ',' per choice
330330
size += len(selection.Choices) * 2
331331
}
332332

333333
for _, text := range s.Texts {
334-
size += len(text.GetString() + "::")
334+
size += len(text.GetID() + "::")
335335
size += len(text.ID)
336336

337337
// at most 4 bytes per character + ',' per answer
@@ -407,7 +407,7 @@ type Question interface {
407407
GetMaxN() uint
408408
GetMinN() uint
409409
GetChoicesLength() int
410-
GetString() string
410+
GetID() string
411411
}
412412

413413
func isValid(q Question) bool {
@@ -425,9 +425,9 @@ type Select struct {
425425
Choices []string
426426
}
427427

428-
// GetString implements Question
429-
func (s Select) GetString() string {
430-
return selectStr
428+
// GetID implements Question
429+
func (s Select) GetID() string {
430+
return selectID
431431
}
432432

433433
// GetMaxN implements Question
@@ -490,8 +490,8 @@ type Rank struct {
490490
Choices []string
491491
}
492492

493-
func (r Rank) GetString() string {
494-
return rankStr
493+
func (r Rank) GetID() string {
494+
return rankID
495495
}
496496

497497
// GetMaxN implements Question
@@ -564,8 +564,8 @@ type Text struct {
564564
Choices []string
565565
}
566566

567-
func (t Text) GetString() string {
568-
return textStr
567+
func (t Text) GetID() string {
568+
return textID
569569
}
570570

571571
// GetMaxN implements Question

contracts/evoting/types/ballots_test.go

+82-82
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,31 @@ import (
99
)
1010

1111
const (
12-
selectStringTest = "select:"
13-
rankStringTest = "rank:"
14-
textStringTest = "text:"
15-
unmarshalingRankString = "could not unmarshal rank answers: "
16-
unmarshalingTextStringTest = "could not unmarshal text answers: "
12+
selectIDTest = "select:"
13+
rankIDTest = "rank:"
14+
textIDTest = "text:"
15+
unmarshalingRankID = "could not unmarshal rank answers: "
16+
unmarshalingTextID = "could not unmarshal text answers: "
1717
)
1818

1919
// Creating a ballot for the first question, which is a select question.
20-
var ballot1 = string(selectStringTest + encodedQuestionID(1) + ":1,0,1\n" +
21-
rankStringTest + encodedQuestionID(2) + ":1,2,0,,\n" +
22-
selectStringTest + encodedQuestionID(3) + ":1,0,1,1\n" +
23-
textStringTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
20+
var ballot1 = string(selectIDTest + encodedQuestionID(1) + ":1,0,1\n" +
21+
rankIDTest + encodedQuestionID(2) + ":1,2,0,,\n" +
22+
selectIDTest + encodedQuestionID(3) + ":1,0,1,1\n" +
23+
textIDTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
2424

2525
// Creating a ballot with the following questions:
2626
// 1. Select one of three options
2727
// 2. Rank four options
2828
// 3. Select one of five options
2929
// 4. Write two text answers
3030
// 5. Write one text answer
31-
var ballot2 = string(selectStringTest + encodedQuestionID(1) + ":0,0,0\n" +
32-
rankStringTest + encodedQuestionID(2) + ":128,128,128,128\n" +
33-
selectStringTest + encodedQuestionID(3) + ":0,0,0,0,0\n" +
34-
textStringTest + encodedQuestionID(4) + ":xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx," +
31+
var ballot2 = string(selectIDTest + encodedQuestionID(1) + ":0,0,0\n" +
32+
rankIDTest + encodedQuestionID(2) + ":128,128,128,128\n" +
33+
selectIDTest + encodedQuestionID(3) + ":0,0,0,0,0\n" +
34+
textIDTest + encodedQuestionID(4) + ":xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx," +
3535
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n" +
36-
textStringTest + encodedQuestionID(5) + ":xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,,\n\n")
36+
textIDTest + encodedQuestionID(5) + ":xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,,\n\n")
3737

3838
func encodedQuestionID(i int) ID {
3939
return ID(base64.StdEncoding.EncodeToString([]byte("Q" + strconv.Itoa(i))))
@@ -120,28 +120,28 @@ func TestBallot_Unmarshal(t *testing.T) {
120120
require.EqualError(t, err, "a line in the ballot has length != 3: x")
121121

122122
// with ID not encoded in base64
123-
ballotWrongID := string(selectStringTest + "aaa" + ":1,0,1\n" +
124-
rankStringTest + encodedQuestionID(2) + ":1,2,0,,\n" +
125-
selectStringTest + encodedQuestionID(3) + ":1,0,1,1\n" +
126-
textStringTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
123+
ballotWrongID := string(selectIDTest + "aaa" + ":1,0,1\n" +
124+
rankIDTest + encodedQuestionID(2) + ":1,2,0,,\n" +
125+
selectIDTest + encodedQuestionID(3) + ":1,0,1,1\n" +
126+
textIDTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
127127

128128
err = b.Unmarshal(ballotWrongID, election)
129129
require.EqualError(t, err, "could not decode question ID: illegal base64 data at input byte 0")
130130

131131
// with question ID not from the election
132-
ballotUnknownID := string(selectStringTest + encodedQuestionID(0) + ":1,0,1\n" +
133-
rankStringTest + encodedQuestionID(2) + ":1,2,0,,\n" +
134-
selectStringTest + encodedQuestionID(3) + ":1,0,1,1\n" +
135-
textStringTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
132+
ballotUnknownID := string(selectIDTest + encodedQuestionID(0) + ":1,0,1\n" +
133+
rankIDTest + encodedQuestionID(2) + ":1,2,0,,\n" +
134+
selectIDTest + encodedQuestionID(3) + ":1,0,1,1\n" +
135+
textIDTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
136136

137137
err = b.Unmarshal(ballotUnknownID, election)
138138
require.EqualError(t, err, "wrong question ID: the question doesn't exist")
139139

140140
// with too many answers in select question
141-
ballotWrongSelect := string(selectStringTest + encodedQuestionID(1) + ":1,0,1,0,0\n" +
142-
rankStringTest + encodedQuestionID(2) + ":1,2,0,,\n" +
143-
selectStringTest + encodedQuestionID(3) + ":1,0,1,1\n" +
144-
textStringTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
141+
ballotWrongSelect := string(selectIDTest + encodedQuestionID(1) + ":1,0,1,0,0\n" +
142+
rankIDTest + encodedQuestionID(2) + ":1,2,0,,\n" +
143+
selectIDTest + encodedQuestionID(3) + ":1,0,1,1\n" +
144+
textIDTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
145145

146146
election.BallotSize = len(ballotWrongSelect)
147147

@@ -151,10 +151,10 @@ func TestBallot_Unmarshal(t *testing.T) {
151151
" of answers: expected 3 got 5")
152152

153153
// with wrong format answers in select question
154-
ballotWrongSelect = string(selectStringTest + encodedQuestionID(1) + ":1,0,wrong\n" +
155-
rankStringTest + encodedQuestionID(2) + ":1,2,0,,\n" +
156-
selectStringTest + encodedQuestionID(3) + ":1,0,1,1\n" +
157-
textStringTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
154+
ballotWrongSelect = string(selectIDTest + encodedQuestionID(1) + ":1,0,wrong\n" +
155+
rankIDTest + encodedQuestionID(2) + ":1,2,0,,\n" +
156+
selectIDTest + encodedQuestionID(3) + ":1,0,1,1\n" +
157+
textIDTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
158158

159159
election.BallotSize = len(ballotWrongSelect)
160160

@@ -164,10 +164,10 @@ func TestBallot_Unmarshal(t *testing.T) {
164164
"ParseBool: parsing \"wrong\": invalid syntax")
165165

166166
// with too many selected answers in select question
167-
ballotWrongSelect = string(selectStringTest + encodedQuestionID(1) + ":1,1,1\n" +
168-
rankStringTest + encodedQuestionID(2) + ":1,2,0,,\n" +
169-
selectStringTest + encodedQuestionID(3) + ":1,0,1,1\n" +
170-
textStringTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
167+
ballotWrongSelect = string(selectIDTest + encodedQuestionID(1) + ":1,1,1\n" +
168+
rankIDTest + encodedQuestionID(2) + ":1,2,0,,\n" +
169+
selectIDTest + encodedQuestionID(3) + ":1,0,1,1\n" +
170+
textIDTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
171171

172172
election.BallotSize = len(ballotWrongSelect)
173173

@@ -176,10 +176,10 @@ func TestBallot_Unmarshal(t *testing.T) {
176176
"failed to check number of answers: question Q1 has too many selected answers")
177177

178178
// with not enough selected answers in select question
179-
ballotWrongSelect = string(selectStringTest + encodedQuestionID(1) + ":1,0,0\n" +
180-
rankStringTest + encodedQuestionID(2) + ":1,2,0,,\n" +
181-
selectStringTest + encodedQuestionID(3) + ":1,0,1,1\n" +
182-
textStringTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
179+
ballotWrongSelect = string(selectIDTest + encodedQuestionID(1) + ":1,0,0\n" +
180+
rankIDTest + encodedQuestionID(2) + ":1,2,0,,\n" +
181+
selectIDTest + encodedQuestionID(3) + ":1,0,1,1\n" +
182+
textIDTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
183183

184184
election.BallotSize = len(ballotWrongSelect)
185185

@@ -188,114 +188,114 @@ func TestBallot_Unmarshal(t *testing.T) {
188188
"failed to check number of answers: question Q1 has not enough selected answers")
189189

190190
// with not enough answers in rank question
191-
ballotWrongRank := string(selectStringTest + encodedQuestionID(1) + ":1,0,1\n" +
192-
rankStringTest + encodedQuestionID(2) + ":1,2,0\n" +
193-
selectStringTest + encodedQuestionID(3) + ":1,0,1,1\n" +
194-
textStringTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
191+
ballotWrongRank := string(selectIDTest + encodedQuestionID(1) + ":1,0,1\n" +
192+
rankIDTest + encodedQuestionID(2) + ":1,2,0\n" +
193+
selectIDTest + encodedQuestionID(3) + ":1,0,1,1\n" +
194+
textIDTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
195195

196196
err = b.Unmarshal(ballotWrongRank, election)
197197
require.EqualError(t, err, "could not unmarshal rank answers: question"+
198198
" Q2 has a wrong number of answers: expected 5 got 3")
199199

200200
// with wrong format answers in rank question
201-
ballotWrongRank = string(selectStringTest + encodedQuestionID(1) + ":1,0,1\n" +
202-
rankStringTest + encodedQuestionID(2) + ":1,x,0,,\n" +
203-
selectStringTest + encodedQuestionID(3) + ":1,0,1,1\n" +
204-
textStringTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
201+
ballotWrongRank = string(selectIDTest + encodedQuestionID(1) + ":1,0,1\n" +
202+
rankIDTest + encodedQuestionID(2) + ":1,x,0,,\n" +
203+
selectIDTest + encodedQuestionID(3) + ":1,0,1,1\n" +
204+
textIDTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
205205

206206
election.BallotSize = len(ballotWrongRank)
207207

208208
err = b.Unmarshal(ballotWrongRank, election)
209-
require.EqualError(t, err, unmarshalingRankString+
209+
require.EqualError(t, err, unmarshalingRankID+
210210
"could not parse rank value for Q.Q2: strconv.ParseInt: parsing \"x\": invalid syntax")
211211

212212
// with too many selected answers in rank question
213-
ballotWrongRank = string(selectStringTest + encodedQuestionID(1) + ":1,0,1\n" +
214-
rankStringTest + encodedQuestionID(2) + ":1,2,0,3,4\n" +
215-
selectStringTest + encodedQuestionID(3) + ":1,0,1,1\n" +
216-
textStringTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
213+
ballotWrongRank = string(selectIDTest + encodedQuestionID(1) + ":1,0,1\n" +
214+
rankIDTest + encodedQuestionID(2) + ":1,2,0,3,4\n" +
215+
selectIDTest + encodedQuestionID(3) + ":1,0,1,1\n" +
216+
textIDTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
217217

218218
election.BallotSize = len(ballotWrongRank)
219219

220220
err = b.Unmarshal(ballotWrongRank, election)
221-
require.EqualError(t, err, unmarshalingRankString+
221+
require.EqualError(t, err, unmarshalingRankID+
222222
"invalid rank not in range [0, MaxN[: 3")
223223

224224
// with valid ranks but one is selected twice
225-
ballotWrongRank = string(selectStringTest + encodedQuestionID(1) + ":1,0,1\n" +
226-
rankStringTest + encodedQuestionID(2) + ":1,2,0,2,2\n" +
227-
selectStringTest + encodedQuestionID(3) + ":1,0,1,1\n" +
228-
textStringTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
225+
ballotWrongRank = string(selectIDTest + encodedQuestionID(1) + ":1,0,1\n" +
226+
rankIDTest + encodedQuestionID(2) + ":1,2,0,2,2\n" +
227+
selectIDTest + encodedQuestionID(3) + ":1,0,1,1\n" +
228+
textIDTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
229229

230230
election.BallotSize = len(ballotWrongRank)
231231

232232
err = b.Unmarshal(ballotWrongRank, election)
233-
require.EqualError(t, err, unmarshalingRankString+
233+
require.EqualError(t, err, unmarshalingRankID+
234234
"failed to check number of answers: question Q2 has too many selected answers")
235235

236236
// with not enough selected answers in rank question
237-
ballotWrongRank = string(selectStringTest + encodedQuestionID(1) + ":1,0,1\n" +
238-
rankStringTest + encodedQuestionID(2) + ":1,,0,,\n" +
239-
selectStringTest + encodedQuestionID(3) + ":1,0,1,1\n" +
240-
textStringTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
237+
ballotWrongRank = string(selectIDTest + encodedQuestionID(1) + ":1,0,1\n" +
238+
rankIDTest + encodedQuestionID(2) + ":1,,0,,\n" +
239+
selectIDTest + encodedQuestionID(3) + ":1,0,1,1\n" +
240+
textIDTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
241241

242242
election.BallotSize = len(ballotWrongRank)
243243

244244
err = b.Unmarshal(ballotWrongRank, election)
245-
require.EqualError(t, err, unmarshalingRankString+
245+
require.EqualError(t, err, unmarshalingRankID+
246246
"failed to check number of answers: question"+
247247
" Q2 has not enough selected answers")
248248

249249
// with not enough answers in text question
250-
ballotWrongText := string(selectStringTest + encodedQuestionID(1) + ":1,0,1\n" +
251-
rankStringTest + encodedQuestionID(2) + ":1,2,0,,\n" +
252-
selectStringTest + encodedQuestionID(3) + ":1,0,1,1\n" +
253-
textStringTest + encodedQuestionID(4) + ":Y2VzdG1vaUVtaQ==\n\n")
250+
ballotWrongText := string(selectIDTest + encodedQuestionID(1) + ":1,0,1\n" +
251+
rankIDTest + encodedQuestionID(2) + ":1,2,0,,\n" +
252+
selectIDTest + encodedQuestionID(3) + ":1,0,1,1\n" +
253+
textIDTest + encodedQuestionID(4) + ":Y2VzdG1vaUVtaQ==\n\n")
254254

255255
election.BallotSize = len(ballotWrongText)
256256

257257
err = b.Unmarshal(ballotWrongText, election)
258-
require.EqualError(t, err, unmarshalingTextStringTest+
258+
require.EqualError(t, err, unmarshalingTextID+
259259
"question Q4 has a wrong number of answers: expected 2 got 1")
260260

261261
// with wrong encoding in text question
262-
ballotWrongText = string(selectStringTest + encodedQuestionID(1) + ":1,0,1\n" +
263-
rankStringTest + encodedQuestionID(2) + ":1,2,0,,\n" +
264-
selectStringTest + encodedQuestionID(3) + ":1,0,1,1\n" +
265-
textStringTest + encodedQuestionID(4) + ":wrongEncoding,Y2VzdG1vaUVtaQ==\n\n")
262+
ballotWrongText = string(selectIDTest + encodedQuestionID(1) + ":1,0,1\n" +
263+
rankIDTest + encodedQuestionID(2) + ":1,2,0,,\n" +
264+
selectIDTest + encodedQuestionID(3) + ":1,0,1,1\n" +
265+
textIDTest + encodedQuestionID(4) + ":wrongEncoding,Y2VzdG1vaUVtaQ==\n\n")
266266

267267
election.BallotSize = len(ballotWrongText)
268268

269269
err = b.Unmarshal(ballotWrongText, election)
270-
require.EqualError(t, err, unmarshalingTextStringTest+
270+
require.EqualError(t, err, unmarshalingTextID+
271271
"could not decode text for Q.Q4: illegal base64 data at input byte 12")
272272

273273
// with too many selected answers in text question
274274
election.Configuration.Scaffold[0].Texts[0].MaxN = 1
275275

276-
ballotWrongText = string(selectStringTest + encodedQuestionID(1) + ":1,0,1\n" +
277-
rankStringTest + encodedQuestionID(2) + ":1,2,0,,\n" +
278-
selectStringTest + encodedQuestionID(3) + ":1,0,1,1\n" +
279-
textStringTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
276+
ballotWrongText = string(selectIDTest + encodedQuestionID(1) + ":1,0,1\n" +
277+
rankIDTest + encodedQuestionID(2) + ":1,2,0,,\n" +
278+
selectIDTest + encodedQuestionID(3) + ":1,0,1,1\n" +
279+
textIDTest + encodedQuestionID(4) + ":YmxhYmxhYmxhZg==,Y2VzdG1vaUVtaQ==\n\n")
280280

281281
election.BallotSize = len(ballotWrongText)
282282

283283
err = b.Unmarshal(ballotWrongText, election)
284-
require.EqualError(t, err, unmarshalingTextStringTest+
284+
require.EqualError(t, err, unmarshalingTextID+
285285
"failed to check number of answers: question Q4 has too many selected answers")
286286

287287
election.Configuration.Scaffold[0].Texts[0].MaxN = 2
288288

289289
// with not enough elected answers in text question
290-
ballotWrongText = string(selectStringTest + encodedQuestionID(1) + ":1,0,1\n" +
291-
rankStringTest + encodedQuestionID(2) + ":1,2,0,,\n" +
292-
selectStringTest + encodedQuestionID(3) + ":1,0,1,1\n" +
293-
textStringTest + encodedQuestionID(4) + ":,Y2VzdG1vaUVtaQ==\n\n")
290+
ballotWrongText = string(selectIDTest + encodedQuestionID(1) + ":1,0,1\n" +
291+
rankIDTest + encodedQuestionID(2) + ":1,2,0,,\n" +
292+
selectIDTest + encodedQuestionID(3) + ":1,0,1,1\n" +
293+
textIDTest + encodedQuestionID(4) + ":,Y2VzdG1vaUVtaQ==\n\n")
294294

295295
election.BallotSize = len(ballotWrongText)
296296

297297
err = b.Unmarshal(ballotWrongText, election)
298-
require.EqualError(t, err, unmarshalingTextStringTest+
298+
require.EqualError(t, err, unmarshalingTextID+
299299
"failed to check number of answers: question Q4 has not enough selected answers")
300300

301301
// with unknown question type

0 commit comments

Comments
 (0)