@@ -22,7 +22,7 @@ func TestParseInterfaceDef(t *testing.T) {
22
22
definition : "Greeting { field: String }" ,
23
23
expected : & types.InterfaceTypeDefinition {
24
24
Name : "Greeting" ,
25
- Loc : errors.Location {1 , 1 },
25
+ Loc : errors.Location {Line : 1 , Column : 1 },
26
26
Fields : types.FieldsDefinition {& types.FieldDefinition {Name : "field" }}},
27
27
}}
28
28
@@ -53,19 +53,19 @@ func TestParseObjectDef(t *testing.T) {
53
53
tests := []testCase {{
54
54
description : "Parses type inheriting single interface" ,
55
55
definition : "Hello implements World { field: String }" ,
56
- expected : & types.ObjectTypeDefinition {Name : "Hello" , Loc : errors.Location {1 , 1 }, InterfaceNames : []string {"World" }},
56
+ expected : & types.ObjectTypeDefinition {Name : "Hello" , Loc : errors.Location {Line : 1 , Column : 1 }, InterfaceNames : []string {"World" }},
57
57
}, {
58
58
description : "Parses type inheriting multiple interfaces" ,
59
59
definition : "Hello implements Wo & rld { field: String }" ,
60
- expected : & types.ObjectTypeDefinition {Name : "Hello" , Loc : errors.Location {1 , 1 }, InterfaceNames : []string {"Wo" , "rld" }},
60
+ expected : & types.ObjectTypeDefinition {Name : "Hello" , Loc : errors.Location {Line : 1 , Column : 1 }, InterfaceNames : []string {"Wo" , "rld" }},
61
61
}, {
62
62
description : "Parses type inheriting multiple interfaces with leading ampersand" ,
63
63
definition : "Hello implements & Wo & rld { field: String }" ,
64
- expected : & types.ObjectTypeDefinition {Name : "Hello" , Loc : errors.Location {1 , 1 }, InterfaceNames : []string {"Wo" , "rld" }},
64
+ expected : & types.ObjectTypeDefinition {Name : "Hello" , Loc : errors.Location {Line : 1 , Column : 1 }, InterfaceNames : []string {"Wo" , "rld" }},
65
65
}, {
66
66
description : "Allows legacy SDL interfaces" ,
67
67
definition : "Hello implements Wo, rld { field: String }" ,
68
- expected : & types.ObjectTypeDefinition {Name : "Hello" , Loc : errors.Location {1 , 1 }, InterfaceNames : []string {"Wo" , "rld" }},
68
+ expected : & types.ObjectTypeDefinition {Name : "Hello" , Loc : errors.Location {Line : 1 , Column : 1 }, InterfaceNames : []string {"Wo" , "rld" }},
69
69
}}
70
70
71
71
for _ , test := range tests {
@@ -97,7 +97,7 @@ func TestParseUnionDef(t *testing.T) {
97
97
expected : & types.Union {
98
98
Name : "Foo" ,
99
99
TypeNames : []string {"Bar" , "Qux" , "Quux" },
100
- Loc : errors.Location {1 , 1 },
100
+ Loc : errors.Location {Line : 1 , Column : 1 },
101
101
},
102
102
},
103
103
}
@@ -133,14 +133,14 @@ func TestParseEnumDef(t *testing.T) {
133
133
EnumValuesDefinition : []* types.EnumValueDefinition {
134
134
{
135
135
EnumValue : "BAR" ,
136
- Loc : errors.Location {1 , 7 },
136
+ Loc : errors.Location {Line : 1 , Column : 7 },
137
137
},
138
138
{
139
139
EnumValue : "QUX" ,
140
- Loc : errors.Location {1 , 11 },
140
+ Loc : errors.Location {Line : 1 , Column : 11 },
141
141
},
142
142
},
143
- Loc : errors.Location {1 , 1 },
143
+ Loc : errors.Location {Line : 1 , Column : 1 },
144
144
},
145
145
},
146
146
{
@@ -154,14 +154,14 @@ func TestParseEnumDef(t *testing.T) {
154
154
EnumValuesDefinition : []* types.EnumValueDefinition {
155
155
{
156
156
EnumValue : "BAR" ,
157
- Loc : errors.Location {2 , 5 },
157
+ Loc : errors.Location {Line : 2 , Column : 5 },
158
158
},
159
159
{
160
160
EnumValue : "QUX" ,
161
- Loc : errors.Location {3 , 5 },
161
+ Loc : errors.Location {Line : 3 , Column : 5 },
162
162
},
163
163
},
164
- Loc : errors.Location {1 , 1 },
164
+ Loc : errors.Location {Line : 1 , Column : 1 },
165
165
},
166
166
},
167
167
}
@@ -194,7 +194,7 @@ func TestParseDirectiveDef(t *testing.T) {
194
194
definition : "@Foo on FIELD" ,
195
195
expected : & types.DirectiveDefinition {
196
196
Name : "Foo" ,
197
- Loc : errors.Location {1 , 2 },
197
+ Loc : errors.Location {Line : 1 , Column : 2 },
198
198
Locations : []string {"FIELD" },
199
199
},
200
200
},
@@ -229,7 +229,7 @@ func TestParseInputDef(t *testing.T) {
229
229
expected : & types.InputObject {
230
230
Name : "Foo" ,
231
231
Values : nil ,
232
- Loc : errors.Location {1 , 1 },
232
+ Loc : errors.Location {Line : 1 , Column : 1 },
233
233
},
234
234
},
235
235
}
0 commit comments