@@ -224,21 +224,22 @@ func TestArgument_String(t *testing.T) {
224
224
225
225
testCases := []testCase {
226
226
{
227
- test : "valid with value string type pointer" ,
227
+ test : "invalid with value string type pointer" ,
228
228
arg : & Argument {
229
229
Name : "argument" ,
230
230
Type : String ,
231
231
Value : new (string ),
232
232
},
233
+ expectedPanic : true ,
233
234
},
234
235
{
235
- test : "invalid value string type with no pointer" ,
236
+ test : "valid value string type with no pointer" ,
236
237
arg : & Argument {
237
238
Name : "argument" ,
238
239
Type : String ,
239
240
Value : "string" ,
240
241
},
241
- expectedPanic : true ,
242
+ expectedPanic : false ,
242
243
},
243
244
{
244
245
test : "invalid value int type with no pointer" ,
@@ -258,7 +259,7 @@ func TestArgument_String(t *testing.T) {
258
259
_ = testCase .arg .String ()
259
260
})
260
261
} else {
261
- require .Equal (t , * testCase .arg .Value .(* string ), testCase .arg .String ())
262
+ require .Equal (t , testCase .arg .Value .(string ), testCase .arg .String ())
262
263
}
263
264
})
264
265
}
@@ -273,21 +274,22 @@ func TestArgument_Int(t *testing.T) {
273
274
274
275
testCases := []testCase {
275
276
{
276
- test : "valid with value int type pointer" ,
277
+ test : "invalid with value int type pointer" ,
277
278
arg : & Argument {
278
279
Name : "argument" ,
279
280
Type : Int ,
280
281
Value : new (int ),
281
282
},
283
+ expectedPanic : true ,
282
284
},
283
285
{
284
- test : "invalid value int type with no pointer" ,
286
+ test : "valid value int type with no pointer" ,
285
287
arg : & Argument {
286
288
Name : "argument" ,
287
289
Type : Int ,
288
290
Value : 0 ,
289
291
},
290
- expectedPanic : true ,
292
+ expectedPanic : false ,
291
293
},
292
294
{
293
295
test : "invalid value string type with no pointer" ,
@@ -307,7 +309,7 @@ func TestArgument_Int(t *testing.T) {
307
309
testCase .arg .Int ()
308
310
})
309
311
} else {
310
- require .Equal (t , * testCase .arg .Value .(* int ), testCase .arg .Int ())
312
+ require .Equal (t , testCase .arg .Value .(int ), testCase .arg .Int ())
311
313
}
312
314
})
313
315
}
@@ -322,21 +324,22 @@ func TestArgument_Bool(t *testing.T) {
322
324
323
325
testCases := []testCase {
324
326
{
325
- test : "valid with value bool type pointer" ,
327
+ test : "invalid with value bool type pointer" ,
326
328
arg : & Argument {
327
329
Name : "argument" ,
328
330
Type : Bool ,
329
331
Value : new (bool ),
330
332
},
333
+ expectedPanic : true ,
331
334
},
332
335
{
333
- test : "invalid value bool type with no pointer" ,
336
+ test : "valid value bool type with no pointer" ,
334
337
arg : & Argument {
335
338
Name : "argument" ,
336
339
Type : Bool ,
337
340
Value : false ,
338
341
},
339
- expectedPanic : true ,
342
+ expectedPanic : false ,
340
343
},
341
344
{
342
345
test : "invalid value string type with no pointer" ,
@@ -356,7 +359,7 @@ func TestArgument_Bool(t *testing.T) {
356
359
testCase .arg .Bool ()
357
360
})
358
361
} else {
359
- require .Equal (t , * testCase .arg .Value .(* bool ), testCase .arg .Bool ())
362
+ require .Equal (t , testCase .arg .Value .(bool ), testCase .arg .Bool ())
360
363
}
361
364
})
362
365
}
0 commit comments