Debian Codegraph @

common/regions_test.go

raw symbols SCIP
1 package common
2
3 import "testing"
4
5 func TestIsValidRegion(t *testing.T) {
6 var tests = []struct {
7 region string
8
9 exp bool
10 }{
11 {"", false},
12
13 {"cn-hangzhou", true},
14 {"us-east-1", true},
15
16 {"hangzhou", false},
17 {"not-unknown", false},
18 }
19 for _, v := range tests {
20 got := IsValidRegion(v.region)
21 if got != v.exp {
22 t.Fail()
23 }
24 }
25 }