github.com/aquayi/gokit@v0.0.0-20170805152833-88827a405d9b/string_test.go (about) 1 package GoKit 2 3 import "testing" 4 import "github.com/stretchr/testify/assert" 5 6 func Test_Message(t *testing.T) { 7 ast := assert.New(t) 8 9 ast.Equal("", Message(), "没有正确处理**空**消息") 10 11 ast.Equal("foo", Message("foo"), "没能正确处理单个消息") 12 13 ast.Equal("foobar", Message("foo%s", "bar"), "没能正确处理带参数的消息") 14 15 ast.Equal("foobar, too", Message("foo%s, %s", "bar", "too"), "没能正确处理带两个参数的消息") 16 }