MCPcopy Create free account
hub / github.com/cel-expr/cel-go / compareUnknownIDs

Function compareUnknownIDs

tools/celtest/test_runner.go:813–826  ·  view source on GitHub ↗
(expectedUnknownIDs, actualUnknownIDs []int64)

Source from the content-addressed store, hash-verified

811}
812
813func compareUnknownIDs(expectedUnknownIDs, actualUnknownIDs []int64) TestResult {
814 sortOption := cmp.Transformer("Sort", func(in []int64) []int64 {
815 out := append([]int64{}, in...)
816 slices.Sort(out)
817 return out
818 })
819 if diff := cmp.Diff(expectedUnknownIDs, actualUnknownIDs, sortOption); diff != "" {
820 return TestResult{
821 Success: false,
822 Wanted: fmt.Sprintf("unknown value %v", expectedUnknownIDs),
823 Error: fmt.Errorf("mismatched test output with diff (-got +want):\n%s", diff)}
824 }
825 return TestResult{Success: true}
826}
827
828func refValueToExprValue(refVal ref.Val) (*exprpb.ExprValue, error) {
829 if types.IsUnknown(refVal) {

Callers 2

createResultMatcherMethod · 0.85

Calls 1

SortMethod · 0.45

Tested by

no test coverage detected