github.com/prasannakumarik25/packer@v1.3.2/helper/useragent/useragent_test.go (about) 1 package useragent 2 3 import ( 4 "testing" 5 ) 6 7 func TestUserAgent(t *testing.T) { 8 projectURL = "https://packer-test.com" 9 rt = "go5.0" 10 goos = "linux" 11 goarch = "amd64" 12 versionFunc = func() string { return "1.2.3" } 13 14 act := String() 15 16 exp := "Packer/1.2.3 (+https://packer-test.com; go5.0; linux/amd64)" 17 if exp != act { 18 t.Errorf("expected %q to be %q", act, exp) 19 } 20 }