mirror of
https://github.com/zrepl/zrepl.git
synced 2025-08-12 16:27:05 +02:00
socketpair: directly export *net.UnixConn (and add test for that behavior)
This commit is contained in:
18
util/socketpair/socketpair_test.go
Normal file
18
util/socketpair/socketpair_test.go
Normal file
@ -0,0 +1,18 @@
|
||||
package socketpair
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
// This is test is mostly to verify that the assumption about
|
||||
// net.FileConn returning *net.UnixConn for AF_UNIX FDs works.
|
||||
func TestSocketPairWorks(t *testing.T) {
|
||||
assert.NotPanics(t, func() {
|
||||
a, b, err := SocketPair()
|
||||
assert.NoError(t, err)
|
||||
a.Close()
|
||||
b.Close()
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user