github.com/lmittmann/w3@v0.20.0/module/net/net_test.go (about)

     1  package net_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/lmittmann/w3/module/net"
     7  	"github.com/lmittmann/w3/rpctest"
     8  )
     9  
    10  func TestListening(t *testing.T) {
    11  	rpctest.RunTestCases(t, []rpctest.TestCase[bool]{
    12  		{
    13  			Golden:  "listening",
    14  			Call:    net.Listening(),
    15  			WantRet: true,
    16  		},
    17  	})
    18  }
    19  
    20  func TestPeerCount(t *testing.T) {
    21  	rpctest.RunTestCases(t, []rpctest.TestCase[int]{
    22  		{
    23  			Golden:  "peer_count",
    24  			Call:    net.PeerCount(),
    25  			WantRet: 10,
    26  		},
    27  	})
    28  }
    29  
    30  func TestVersion(t *testing.T) {
    31  	rpctest.RunTestCases(t, []rpctest.TestCase[int]{
    32  		{
    33  			Golden:  "version",
    34  			Call:    net.Version(),
    35  			WantRet: 1,
    36  		},
    37  	})
    38  }