MCPcopy Create free account
hub / github.com/moby/moby / TestAllNum

Function TestAllNum

daemon/internal/stringid/stringid_test.go:58–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

56}
57
58func TestAllNum(t *testing.T) {
59 tests := []struct {
60 doc, id string
61 expected bool
62 }{
63 {
64 doc: "mixed letters and numbers",
65 id: "4e38e38c8ce0",
66 expected: false,
67 },
68 {
69 doc: "letters only",
70 id: "deadbeefcafe",
71 expected: false,
72 },
73 {
74 doc: "numbers only",
75 id: "012345678912",
76 expected: true,
77 },
78 }
79 for _, tc := range tests {
80 t.Run(tc.doc, func(t *testing.T) {
81 if actual := allNum(tc.id); actual != tc.expected {
82 t.Errorf("expected %q to be %t, got %t, ", tc.id, !tc.expected, actual)
83 }
84 })
85 }
86}

Callers

nothing calls this directly

Calls 3

allNumFunction · 0.85
ErrorfMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…