mirror of
https://github.com/bluenviron/mediamtx
synced 2025-01-23 07:23:34 +00:00
23 lines
301 B
Go
23 lines
301 B
Go
package asyncwriter
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestAsyncWriter(t *testing.T) {
|
|
w := New(512, nil)
|
|
|
|
w.Start()
|
|
defer w.Stop()
|
|
|
|
w.Push(func() error {
|
|
return fmt.Errorf("testerror")
|
|
})
|
|
|
|
err := <-w.Error()
|
|
require.EqualError(t, err, "testerror")
|
|
}
|