github.com/gotranspile/cxgo@v0.3.8-0.20240118201721-29871598a6a2/runtime/cnet/arpa_test.go (about)

     1  package cnet
     2  
     3  import (
     4  	"net"
     5  	"testing"
     6  
     7  	"github.com/gotranspile/cxgo/runtime/libc"
     8  	"github.com/stretchr/testify/require"
     9  )
    10  
    11  func TestNtoa(t *testing.T) {
    12  	ip := net.IPv4(127, 0, 0, 1)
    13  	b := Ntoa(Address{Addr: ipToInt4(ip)})
    14  	s := libc.GoString(b)
    15  	require.Equal(t, "127.0.0.1", s)
    16  }