github.com/keysonZZZ/kmg@v0.0.0-20151121023212-05317bfd7d39/kmgNet/netTester/netTester_test.go (about)

     1  package netTester
     2  
     3  import (
     4  	"net"
     5  	"testing"
     6  )
     7  
     8  func TestRunTcpListenerDialerTest(ot *testing.T) {
     9  	RunTcpListenerDialerTest(func() (net.Listener, error) {
    10  		return net.Listen("tcp", "127.0.0.1:50000")
    11  	}, func() (net.Conn, error) {
    12  		return net.Dial("tcp", "127.0.0.1:50000")
    13  	}, false)
    14  }
    15  
    16  func TestRunTcpTestWithNetDialAndNetListener(ot *testing.T) {
    17  	RunTcpTestWithNetDialAndNetListener("127.0.0.1:50000", "127.0.0.1:50000", false)
    18  }