// Copyright 2024 Matthew Rich . All rights reserved. package ext import ( "testing" "github.com/stretchr/testify/assert" "strings" _ "fmt" _ "log" ) func TestNewWriteAddCloser(t *testing.T) { var testWriter strings.Builder closer := WriteAddCloser(WriteNopCloser(&testWriter), func() error { testWriter.Write([]byte("foo")); return nil }) closer.Close() assert.Equal(t, "foo", testWriter.String()) }