pulumi/pkg/integrationtesting/lumiprogram_test.go

20 lines
475 B
Go
Raw Normal View History

package integrationtesting
import (
"bytes"
"testing"
"github.com/stretchr/testify/assert"
2017-07-13 21:40:10 +02:00
"github.com/pulumi/lumi/pkg/util/contract"
)
func Test_Prefixer(t *testing.T) {
byts := make([]byte, 0, 1000)
buf := bytes.NewBuffer(byts)
prefixer := newPrefixer(buf, "OK: ")
2017-07-13 21:40:10 +02:00
_, err := prefixer.Write([]byte("\nsadsada\n\nasdsadsa\nasdsadsa\n"))
contract.Assert(err == nil)
assert.Equal(t, []byte("OK: \nOK: sadsada\nOK: \nOK: asdsadsa\nOK: asdsadsa\n"), buf.Bytes())
}