github.com/franciscocpg/up@v0.1.10/platform/lambda/regions/regions_test.go (about) 1 package regions 2 3 import ( 4 "testing" 5 6 "github.com/tj/assert" 7 ) 8 9 func TestMatch(t *testing.T) { 10 t.Run("explicit", func(t *testing.T) { 11 v := Match([]string{"us-west-2", "us-east-1"}) 12 assert.Equal(t, []string{"us-west-2", "us-east-1"}, v) 13 }) 14 15 t.Run("glob all", func(t *testing.T) { 16 v := Match([]string{"*"}) 17 assert.Equal(t, All, v) 18 }) 19 20 t.Run("glob some", func(t *testing.T) { 21 v := Match([]string{"us-west-*", "ca-*"}) 22 e := []string{"us-west-2", "us-west-1", "ca-central-1"} 23 assert.Equal(t, e, v) 24 }) 25 }