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

Function TestValidIdentifiers

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

Source from the content-addressed store, hash-verified

24)
25
26func TestValidIdentifiers(t *testing.T) {
27 for _, input := range []string{
28 "default",
29 "Default",
30 t.Name(),
31 "default-default",
32 "containerd.io",
33 "foo.boo",
34 "swarmkit.docker.io",
35 "0912341234",
36 "task.0.0123456789",
37 "container.system-75-f19a.00",
38 "underscores_are_allowed",
39 strings.Repeat("a", maxLength),
40 } {
41 t.Run(input, func(t *testing.T) {
42 if err := Validate(input); err != nil {
43 t.Fatalf("unexpected error: %v != nil", err)
44 }
45 })
46 }
47}
48
49func TestInvalidIdentifiers(t *testing.T) {
50 for _, input := range []string{

Callers

nothing calls this directly

Calls 3

ValidateFunction · 0.70
NameMethod · 0.65
RunMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…