22 lines
473 B
Go
22 lines
473 B
Go
// Copyright 2024 Matthew Rich <matthewrich.conf@gmail.com>. All rights reserved.
|
|
|
|
package ext
|
|
|
|
import (
|
|
"testing"
|
|
"github.com/stretchr/testify/assert"
|
|
"strings"
|
|
_ "fmt"
|
|
_ "log"
|
|
)
|
|
|
|
func TestNewWriteNopCloser(t *testing.T) {
|
|
var testWriter strings.Builder
|
|
closer := WriteNopCloser(&testWriter)
|
|
assert.NotNil(t, closer)
|
|
_, err := closer.Write([]byte("test data"))
|
|
assert.Nil(t, err)
|
|
assert.Equal(t, "test data", testWriter.String())
|
|
assert.Nil(t, closer.Close())
|
|
}
|