@@ -125,41 +125,41 @@ func TestCheckSingularFuncArgs(t *testing.T) {
125125
126126 for _ , tc := range []struct {
127127 name string
128- expr []spec.FunctionExprArg
128+ expr []spec.FuncExprArg
129129 err string
130130 lengthErr string
131131 countErr string
132132 valueErr string
133133 }{
134134 {
135135 name : "no_args" ,
136- expr : []spec.FunctionExprArg {},
136+ expr : []spec.FuncExprArg {},
137137 err : "expected 1 argument but found 0" ,
138138 },
139139 {
140140 name : "two_args" ,
141- expr : []spec.FunctionExprArg {spec .Literal (nil ), spec .Literal (nil )},
141+ expr : []spec.FuncExprArg {spec .Literal (nil ), spec .Literal (nil )},
142142 err : "expected 1 argument but found 2" ,
143143 },
144144 {
145145 name : "literal_string" ,
146- expr : []spec.FunctionExprArg {spec .Literal (nil )},
146+ expr : []spec.FuncExprArg {spec .Literal (nil )},
147147 countErr : "cannot convert argument to PathNodes" ,
148148 valueErr : "cannot convert argument to PathNodes" ,
149149 },
150150 {
151151 name : "singular_query" ,
152- expr : []spec.FunctionExprArg {spec .SingularQuery (false , nil )},
152+ expr : []spec.FuncExprArg {spec .SingularQuery (false , nil )},
153153 },
154154 {
155155 name : "nodes_query" ,
156- expr : []spec.FunctionExprArg {spec .NodesQuery (
156+ expr : []spec.FuncExprArg {spec .NodesQuery (
157157 spec .Query (true , spec .Child (spec .Name ("x" ))),
158158 )},
159159 },
160160 {
161161 name : "logical_func_expr" ,
162- expr : []spec.FunctionExprArg {spec .Function (reg .Get ("match" ),
162+ expr : []spec.FuncExprArg {spec .Function (reg .Get ("match" ),
163163 spec .NodesQuery (
164164 spec .Query (true , spec .Child (spec .Name ("x" ))),
165165 ),
@@ -171,7 +171,7 @@ func TestCheckSingularFuncArgs(t *testing.T) {
171171 },
172172 {
173173 name : "logical_or" ,
174- expr : []spec.FunctionExprArg {spec.LogicalOr {}},
174+ expr : []spec.FuncExprArg {spec.LogicalOr {}},
175175 lengthErr : "cannot convert argument to ValueType" ,
176176 countErr : "cannot convert argument to PathNodes" ,
177177 valueErr : "cannot convert argument to PathNodes" ,
@@ -222,59 +222,59 @@ func TestCheckRegexFuncArgs(t *testing.T) {
222222
223223 for _ , tc := range []struct {
224224 name string
225- expr []spec.FunctionExprArg
225+ expr []spec.FuncExprArg
226226 err string
227227 }{
228228 {
229229 name : "no_args" ,
230- expr : []spec.FunctionExprArg {},
230+ expr : []spec.FuncExprArg {},
231231 err : "expected 2 arguments but found 0" ,
232232 },
233233 {
234234 name : "one_arg" ,
235- expr : []spec.FunctionExprArg {spec .Literal ("hi" )},
235+ expr : []spec.FuncExprArg {spec .Literal ("hi" )},
236236 err : "expected 2 arguments but found 1" ,
237237 },
238238 {
239239 name : "three_args" ,
240- expr : []spec.FunctionExprArg {spec .Literal ("hi" ), spec .Literal ("hi" ), spec .Literal ("hi" )},
240+ expr : []spec.FuncExprArg {spec .Literal ("hi" ), spec .Literal ("hi" ), spec .Literal ("hi" )},
241241 err : "expected 2 arguments but found 3" ,
242242 },
243243 {
244244 name : "logical_or_1" ,
245- expr : []spec.FunctionExprArg {& spec.LogicalOr {}, spec .Literal ("hi" )},
245+ expr : []spec.FuncExprArg {& spec.LogicalOr {}, spec .Literal ("hi" )},
246246 err : "cannot convert argument 1 to PathNodes" ,
247247 },
248248 {
249249 name : "logical_or_2" ,
250- expr : []spec.FunctionExprArg {spec .Literal ("hi" ), spec.LogicalOr {}},
250+ expr : []spec.FuncExprArg {spec .Literal ("hi" ), spec.LogicalOr {}},
251251 err : "cannot convert argument 2 to PathNodes" ,
252252 },
253253 {
254254 name : "singular_query_literal" ,
255- expr : []spec.FunctionExprArg {& spec.SingularQueryExpr {}, spec .Literal ("hi" )},
255+ expr : []spec.FuncExprArg {& spec.SingularQueryExpr {}, spec .Literal ("hi" )},
256256 },
257257 {
258258 name : "literal_singular_query" ,
259- expr : []spec.FunctionExprArg {spec .Literal ("hi" ), & spec.SingularQueryExpr {}},
259+ expr : []spec.FuncExprArg {spec .Literal ("hi" ), & spec.SingularQueryExpr {}},
260260 },
261261 {
262262 name : "nodes_query_1" ,
263- expr : []spec.FunctionExprArg {
263+ expr : []spec.FuncExprArg {
264264 spec .NodesQuery (spec .Query (true , spec .Child (spec .Name ("x" )))),
265265 spec .Literal ("hi" ),
266266 },
267267 },
268268 {
269269 name : "nodes_query_2" ,
270- expr : []spec.FunctionExprArg {
270+ expr : []spec.FuncExprArg {
271271 spec .Literal ("hi" ),
272272 spec .NodesQuery (spec .Query (true , spec .Child (spec .Name ("x" )))),
273273 },
274274 },
275275 {
276276 name : "func_expr_1" ,
277- expr : []spec.FunctionExprArg {
277+ expr : []spec.FuncExprArg {
278278 spec .Function (
279279 reg .Get ("match" ),
280280 spec .NodesQuery (spec .Query (true , spec .Child (spec .Name ("x" )))),
@@ -286,7 +286,7 @@ func TestCheckRegexFuncArgs(t *testing.T) {
286286 },
287287 {
288288 name : "func_expr_2" ,
289- expr : []spec.FunctionExprArg {
289+ expr : []spec.FuncExprArg {
290290 spec .Literal ("hi" ),
291291 spec .Function (
292292 reg .Get ("match" ),
0 commit comments