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

Method createTestsFromTextproto

tools/celtest/test_runner.go:639–657  ·  view source on GitHub ↗
(t *testing.T, testSuite *conformancepb.TestSuite)

Source from the content-addressed store, hash-verified

637}
638
639func (tr *TestRunner) createTestsFromTextproto(t *testing.T, testSuite *conformancepb.TestSuite) ([]*Test, error) {
640 var tests []*Test
641 for _, section := range testSuite.GetSections() {
642 sectionName := section.GetName()
643 for _, testCase := range section.GetTests() {
644 testName := fmt.Sprintf("%s/%s", sectionName, testCase.GetName())
645 testInput, err := tr.createTestInputFromPB(t, testCase)
646 if err != nil {
647 return nil, err
648 }
649 testResultMatcher, err := tr.createResultMatcherFromPB(t, testCase)
650 if err != nil {
651 return nil, err
652 }
653 tests = append(tests, NewTest(testName, testInput, testResultMatcher))
654 }
655 }
656 return tests, nil
657}
658
659func (tr *TestRunner) createTestInputFromPB(t *testing.T, testCase *conformancepb.TestCase) (cel.PartialActivation, error) {
660 t.Helper()

Callers 1

TestsMethod · 0.95

Calls 4

createTestInputFromPBMethod · 0.95
NewTestFunction · 0.85
GetNameMethod · 0.45

Tested by

no test coverage detected