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

Function TestParseDescriptions

common/doc_test.go:54–89  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

52}
53
54func TestParseDescriptions(t *testing.T) {
55 tests := []struct {
56 name string
57 in string
58 out []string
59 }{
60 {
61 name: "empty",
62 },
63 {
64 name: "single",
65 in: "hello",
66 out: []string{"hello"},
67 },
68 {
69 name: "multi",
70 in: "bar\nbaz\n\nfoo",
71 out: []string{"bar\nbaz", "foo"},
72 },
73 {
74 name: "multi",
75 in: "hello\n\n\nworld",
76 out: []string{"hello", "world"},
77 },
78 }
79
80 for _, tst := range tests {
81 tc := tst
82 t.Run(tc.name, func(t *testing.T) {
83 out := ParseDescriptions(tc.in)
84 if !reflect.DeepEqual(out, tc.out) {
85 t.Errorf("ParseDescriptions() got %v, wanted %v", out, tc.out)
86 }
87 })
88 }
89}
90
91func TestNewDoc(t *testing.T) {
92 tests := []struct {

Callers

nothing calls this directly

Calls 1

ParseDescriptionsFunction · 0.85

Tested by

no test coverage detected