(t *testing.T)
| 92 | } |
| 93 | |
| 94 | func TestIPAddrToNetIP_Error_InvalidBytes(t *testing.T) { |
| 95 | bad := []byte{1} // invalid length -> AddrFromSlice returns ok=false |
| 96 | got, err := ipAddrToNetIP(bad, "") |
| 97 | require.Equal(t, netip.Addr{}, got, "should return zero addr on error") |
| 98 | require.Error(t, err) |
| 99 | require.IsType(t, ipConvertError{}, err) |
| 100 | require.Contains(t, err.Error(), "failed to convert IP") |
| 101 | } |
| 102 | |
| 103 | func TestIPAddrToNetIP_OK_IPv4(t *testing.T) { |
| 104 | ipv4 := []byte{1, 2, 3, 4} |
nothing calls this directly
no test coverage detected
searching dependent graphs…