github.phpd.cn/hashicorp/packer@v1.3.2/builder/amazon/common/template_funcs_test.go (about) 1 package common 2 3 import ( 4 "testing" 5 ) 6 7 func TestAMITemplatePrepare_clean(t *testing.T) { 8 origName := "AMZamz09()./-_:&^ $%[]#'@" 9 expected := "AMZamz09()./-_--- --[]-'@" 10 11 name := templateCleanAMIName(origName) 12 13 if name != expected { 14 t.Fatalf("template names do not match: expected %s got %s\n", expected, name) 15 } 16 }