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

Function TestContainers_Extend_Name

common/containers/container_test.go:221–247  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

219}
220
221func TestContainers_Extend_Name(t *testing.T) {
222 c, err := DefaultContainer.Extend(Name(""))
223 if err != nil {
224 t.Fatal(err)
225 }
226 if c.Name() != "" {
227 t.Errorf("got %v, wanted empty name", c.Name())
228 }
229 c, err = DefaultContainer.Extend(Name("hello.container"))
230 if err != nil {
231 t.Fatal(err)
232 }
233 if c.Name() != "hello.container" {
234 t.Errorf("got container name %s, wanted 'hello.container'", c.Name())
235 }
236 c, err = c.Extend(Name("goodbye.container"))
237 if err != nil {
238 t.Fatal(err)
239 }
240 if c.Name() != "goodbye.container" {
241 t.Errorf("got container name %s, wanted 'goodbye.container'", c.Name())
242 }
243 c, err = c.Extend(Name(".bad.container"))
244 if err == nil {
245 t.Errorf("got %v, wanted error", c.Name())
246 }
247}
248
249func TestContainers_ToQualifiedName(t *testing.T) {
250 fac := ast.NewExprFactory()

Callers

nothing calls this directly

Calls 3

NameFunction · 0.85
NameMethod · 0.65
ExtendMethod · 0.45

Tested by

no test coverage detected