SSE: Warn on dropped items in Union in Math Operation (#72682)

This commit is contained in:
Kyle Brandt
2023-08-03 14:23:18 -04:00
committed by GitHub
parent 0d48ac2419
commit d0ad4fcd0a
4 changed files with 122 additions and 13 deletions
+3 -1
View File
@@ -4,6 +4,7 @@ import (
"testing"
"github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/expr/mathexp/parse"
"github.com/stretchr/testify/assert"
)
@@ -293,7 +294,8 @@ func Test_union(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
unions := union(tt.aResults, tt.bResults)
fakeNode := &parse.BinaryNode{Args: [2]parse.Node{&parse.VarNode{}, &parse.VarNode{}}}
unions := (&State{}).union(tt.aResults, tt.bResults, fakeNode)
tt.unionsAre(t, tt.unions, unions)
})
}