pulumi/pkg/testing/integration/lumiprogram_test.go
joeduffy ed58a2cbd1 Run empty plan/deploy in integration tests
This change tests that a plan and deploy immediately following another
deploy, when no edits have taken place, correctly results in no action.

I also cleaned up a few things in the code, like using fmt.Printf rather
than fmt.Fprintf(os.Stdout, ...), to clean up error paths, giving the
package a slightly shorter name, and adding missing copyright headers.

This is part of pulumi/pulumi-fabric#310.
2017-08-05 11:37:14 -07:00

22 lines
543 B
Go

// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
package integration
import (
"bytes"
"testing"
"github.com/stretchr/testify/assert"
"github.com/pulumi/pulumi-fabric/pkg/util/contract"
)
func TestPrefixer(t *testing.T) {
byts := make([]byte, 0, 1000)
buf := bytes.NewBuffer(byts)
prefixer := newPrefixer(buf, "OK: ")
_, 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())
}