github.com/xuyutom/docker@v1.6.0/pkg/namesgenerator/names-generator_test.go (about) 1 package namesgenerator 2 3 import ( 4 "testing" 5 ) 6 7 // Make sure the generated names are awesome 8 func TestGenerateAwesomeNames(t *testing.T) { 9 name := GetRandomName(0) 10 if !isAwesome(name) { 11 t.Fatalf("Generated name '%s' is not awesome.", name) 12 } 13 } 14 15 // To be awesome, a container name must involve cool inventors, be easy to remember, 16 // be at least mildly funny, and always be politically correct for enterprise adoption. 17 func isAwesome(name string) bool { 18 coolInventorNames := true 19 easyToRemember := true 20 mildlyFunnyOnOccasion := true 21 politicallyCorrect := true 22 return coolInventorNames && easyToRemember && mildlyFunnyOnOccasion && politicallyCorrect 23 }