MCPcopy Index your code
hub / github.com/bytebase/bytebase / TestIsValidResourceID

Function TestIsValidResourceID

backend/api/v1/common_test.go:11–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestIsValidResourceID(t *testing.T) {
12 tests := []struct {
13 resourceID string
14 want bool
15 }{
16 {
17 resourceID: "hello123",
18 want: true,
19 },
20 {
21 resourceID: "hello-123",
22 want: true,
23 },
24 {
25 resourceID: "你好",
26 want: false,
27 },
28 {
29 resourceID: "123abc",
30 want: false,
31 },
32 {
33 resourceID: "a1234567890123456789012345678901234567890123456789012345678901234567890",
34 want: false,
35 },
36 }
37
38 for _, test := range tests {
39 got := isValidResourceID(test.resourceID)
40 require.Equal(t, test.want, got, test.resourceID)
41 }
42}
43
44func TestParseFilter(t *testing.T) {
45 testCases := []struct {

Callers

nothing calls this directly

Calls 2

isValidResourceIDFunction · 0.85
EqualMethod · 0.65

Tested by

no test coverage detected