MCPcopy Index your code
hub / github.com/containerd/containerd / TestInvalidIdentifiers

Function TestInvalidIdentifiers

pkg/identifiers/validate_test.go:49–73  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

47}
48
49func TestInvalidIdentifiers(t *testing.T) {
50 for _, input := range []string{
51 "",
52 ".foo..foo",
53 "foo/foo",
54 "foo/..",
55 "foo..foo",
56 "foo.-boo",
57 "-foo.boo",
58 "foo.boo-",
59 "but__only_tasteful_underscores",
60 "zn--e9.org", // or something like it!
61 "default--default",
62 strings.Repeat("a", maxLength+1),
63 } {
64
65 t.Run(input, func(t *testing.T) {
66 if err := Validate(input); err == nil {
67 t.Fatal("expected invalid error")
68 } else if !errdefs.IsInvalidArgument(err) {
69 t.Fatal("error should be an invalid identifier error")
70 }
71 })
72 }
73}

Callers

nothing calls this directly

Calls 3

FatalMethod · 0.80
ValidateFunction · 0.70
RunMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…