Skip to content

Commit 9296b87

Browse files
authored
Fix remove checkNilCase test helper function (#504)
1 parent eb32f6c commit 9296b87

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

internal/schema/schema_internal_test.go

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,6 @@ func TestParseInputDef(t *testing.T) {
251251
func compareDirectiveDefinitions(t *testing.T, expected *types.DirectiveDefinition, actual *types.DirectiveDefinition) {
252252
t.Helper()
253253

254-
checkNilCase(t, expected, actual)
255-
256254
if expected.Name != actual.Name {
257255
t.Fatalf("wrong DirectiveDefinition name: want %q, got %q", expected.Name, actual.Name)
258256
}
@@ -267,8 +265,6 @@ func compareDirectiveDefinitions(t *testing.T, expected *types.DirectiveDefiniti
267265
func compareInputObjectTypeDefinition(t *testing.T, expected, actual *types.InputObject) {
268266
t.Helper()
269267

270-
checkNilCase(t, expected, actual)
271-
272268
if expected.Name != actual.Name {
273269
t.Fatalf("wrong InputObject name: want %q, got %q", expected.Name, actual.Name)
274270
}
@@ -279,8 +275,6 @@ func compareInputObjectTypeDefinition(t *testing.T, expected, actual *types.Inpu
279275
func compareEnumTypeDefs(t *testing.T, expected, actual *types.EnumTypeDefinition) {
280276
t.Helper()
281277

282-
checkNilCase(t, expected, actual)
283-
284278
if expected.Name != actual.Name {
285279
t.Fatalf("wrong EnumTypeDefinition name: want %q, got %q", expected.Name, actual.Name)
286280
}
@@ -327,8 +321,6 @@ func compareErrors(t *testing.T, expected, actual *errors.QueryError) {
327321
func compareInterfaces(t *testing.T, expected, actual *types.InterfaceTypeDefinition) {
328322
t.Helper()
329323

330-
checkNilCase(t, expected, actual)
331-
332324
if expected.Name != actual.Name {
333325
t.Errorf("wrong interface name: want %q, got %q", expected.Name, actual.Name)
334326
}
@@ -349,8 +341,6 @@ func compareInterfaces(t *testing.T, expected, actual *types.InterfaceTypeDefini
349341
func compareUnions(t *testing.T, expected, actual *types.Union) {
350342
t.Helper()
351343

352-
checkNilCase(t, expected, actual)
353-
354344
if expected.Name != actual.Name {
355345
t.Errorf("wrong object name: want %q, got %q", expected.Name, actual.Name)
356346
}
@@ -363,8 +353,6 @@ func compareUnions(t *testing.T, expected, actual *types.Union) {
363353
func compareObjects(t *testing.T, expected, actual *types.ObjectTypeDefinition) {
364354
t.Helper()
365355

366-
checkNilCase(t, expected, actual)
367-
368356
if expected.Name != actual.Name {
369357
t.Errorf("wrong object name: want %q, got %q", expected.Name, actual.Name)
370358
}
@@ -385,19 +373,6 @@ func compareObjects(t *testing.T, expected, actual *types.ObjectTypeDefinition)
385373
}
386374
}
387375

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-
401376
func setup(t *testing.T, def string) *common.Lexer {
402377
t.Helper()
403378

0 commit comments

Comments
 (0)