github.com/goreleaser/nfpm/v2@v2.44.0/deprecation/deprecation_test.go (about)

     1  package deprecation
     2  
     3  import (
     4  	"bytes"
     5  	"testing"
     6  
     7  	"github.com/stretchr/testify/require"
     8  )
     9  
    10  func TestNotice(t *testing.T) {
    11  	var b bytes.Buffer
    12  	Noticer = prefixed{&b}
    13  	Print("blah\n")
    14  	Printf("blah: %v\n", true)
    15  	Println("foobar")
    16  	require.Equal(t, "DEPRECATION WARNING: blah\nDEPRECATION WARNING: blah: true\nDEPRECATION WARNING: foobar\n", b.String())
    17  }