Skip to content

Commit ce12d2d

Browse files
committed
Check error returned by DefineCustomFunctions()
1 parent 949a342 commit ce12d2d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

compute_parser_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ import (
77
)
88

99
func TestParseCompute(t *testing.T) {
10-
DefineCustomFunctions([]CustomFunctionInput{
10+
err := DefineCustomFunctions([]CustomFunctionInput{
1111
{Name: "zeroArgFunc", NumParams: []int{0}},
1212
{Name: "oneArgFunc", NumParams: []int{1}},
1313
{Name: "twoArgFunc", NumParams: []int{2}},
1414
})
1515

16+
if err != nil {
17+
t.Error(err)
18+
t.FailNow()
19+
}
20+
1621
type testcase struct {
1722
computeStrings []string
1823
shouldPass bool
@@ -39,7 +44,8 @@ func TestParseCompute(t *testing.T) {
3944

4045
for i, v := range testCases {
4146

42-
result, err := ParseComputeString(context.Background(), strings.Join(v.computeStrings, ","))
47+
var result *GoDataComputeQuery
48+
result, err = ParseComputeString(context.Background(), strings.Join(v.computeStrings, ","))
4349
if v.shouldPass {
4450
if err != nil {
4551
t.Errorf("testcase %d: %v", i, err)

0 commit comments

Comments
 (0)