From 585513b3f8bde8a5f575051183f39d9b9391d11a Mon Sep 17 00:00:00 2001 From: Ben Ye Date: Fri, 1 Nov 2024 19:59:40 -0700 Subject: [PATCH] fix walk call test Signed-off-by: Ben Ye --- walk_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/walk_test.go b/walk_test.go index e984be1..7515c84 100644 --- a/walk_test.go +++ b/walk_test.go @@ -85,6 +85,12 @@ func TestWalkCall(t *testing.T) { } require.True(t, slices.Contains(tc.valueTypes, c.Func.ReturnType)) for i, arg := range c.Args { + // Only happen for functions with variadic set to -1 like label_join. + // Hardcode its value to ensure it is string type. + if i >= len(c.Func.ArgTypes) { + require.Equal(t, parser.ValueTypeString, arg.Type()) + continue + } require.Equal(t, c.Func.ArgTypes[i], arg.Type()) } })