github.com/ttysteale/packer@v0.8.2-0.20150708160520-e5f8ea386ed8/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 }