photoprism/pkg/capture/output_test.go

19 lines
255 B
Go

package capture
import (
"fmt"
"os"
"testing"
"github.com/stretchr/testify/assert"
)
func TestOutput(t *testing.T) {
result := Output(func() {
fmt.Fprint(os.Stdout, "foo")
fmt.Fprint(os.Stderr, "bar")
})
assert.Equal(t, "foobar", result)
}