(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func 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 | |
| 44 | func TestParseFilter(t *testing.T) { |
| 45 | testCases := []struct { |
nothing calls this directly
no test coverage detected