@@ -251,8 +251,6 @@ func TestParseInputDef(t *testing.T) {
251
251
func compareDirectiveDefinitions (t * testing.T , expected * types.DirectiveDefinition , actual * types.DirectiveDefinition ) {
252
252
t .Helper ()
253
253
254
- checkNilCase (t , expected , actual )
255
-
256
254
if expected .Name != actual .Name {
257
255
t .Fatalf ("wrong DirectiveDefinition name: want %q, got %q" , expected .Name , actual .Name )
258
256
}
@@ -267,8 +265,6 @@ func compareDirectiveDefinitions(t *testing.T, expected *types.DirectiveDefiniti
267
265
func compareInputObjectTypeDefinition (t * testing.T , expected , actual * types.InputObject ) {
268
266
t .Helper ()
269
267
270
- checkNilCase (t , expected , actual )
271
-
272
268
if expected .Name != actual .Name {
273
269
t .Fatalf ("wrong InputObject name: want %q, got %q" , expected .Name , actual .Name )
274
270
}
@@ -279,8 +275,6 @@ func compareInputObjectTypeDefinition(t *testing.T, expected, actual *types.Inpu
279
275
func compareEnumTypeDefs (t * testing.T , expected , actual * types.EnumTypeDefinition ) {
280
276
t .Helper ()
281
277
282
- checkNilCase (t , expected , actual )
283
-
284
278
if expected .Name != actual .Name {
285
279
t .Fatalf ("wrong EnumTypeDefinition name: want %q, got %q" , expected .Name , actual .Name )
286
280
}
@@ -327,8 +321,6 @@ func compareErrors(t *testing.T, expected, actual *errors.QueryError) {
327
321
func compareInterfaces (t * testing.T , expected , actual * types.InterfaceTypeDefinition ) {
328
322
t .Helper ()
329
323
330
- checkNilCase (t , expected , actual )
331
-
332
324
if expected .Name != actual .Name {
333
325
t .Errorf ("wrong interface name: want %q, got %q" , expected .Name , actual .Name )
334
326
}
@@ -349,8 +341,6 @@ func compareInterfaces(t *testing.T, expected, actual *types.InterfaceTypeDefini
349
341
func compareUnions (t * testing.T , expected , actual * types.Union ) {
350
342
t .Helper ()
351
343
352
- checkNilCase (t , expected , actual )
353
-
354
344
if expected .Name != actual .Name {
355
345
t .Errorf ("wrong object name: want %q, got %q" , expected .Name , actual .Name )
356
346
}
@@ -363,8 +353,6 @@ func compareUnions(t *testing.T, expected, actual *types.Union) {
363
353
func compareObjects (t * testing.T , expected , actual * types.ObjectTypeDefinition ) {
364
354
t .Helper ()
365
355
366
- checkNilCase (t , expected , actual )
367
-
368
356
if expected .Name != actual .Name {
369
357
t .Errorf ("wrong object name: want %q, got %q" , expected .Name , actual .Name )
370
358
}
@@ -385,19 +373,6 @@ func compareObjects(t *testing.T, expected, actual *types.ObjectTypeDefinition)
385
373
}
386
374
}
387
375
388
- func checkNilCase (t * testing.T , a , b interface {}) {
389
- t .Helper ()
390
-
391
- switch {
392
- case a == nil && a == b :
393
- return
394
- case a == nil && b != nil :
395
- t .Fatalf ("wanted nil, got an unexpected result: %#v" , b )
396
- case a != nil && b == nil :
397
- t .Fatalf ("wanted non-nil result, got nil" )
398
- }
399
- }
400
-
401
376
func setup (t * testing.T , def string ) * common.Lexer {
402
377
t .Helper ()
403
378
0 commit comments