anchor.diff:      %%--------------------------------------------------------------------
       %% regular test case
       io:format("test: parse_hostport/1 - 1~n"),
  -    {"foo.bar", "42"} = sipparse_util:parse_hostport("foo.bar:42"),
  +    {"foo.bar", 42} = sipparse_util:parse_hostport("foo.bar:42"),
       %% test trailing "." in host name
       io:format("test: parse_hostport/1 - 2~n"),
  -    {"foo", "42"} = sipparse_util:parse_hostport("foo.:42"),
  +    {"foo", 42} = sipparse_util:parse_hostport("foo.:42"),
       %% trailing "." and no port
       io:format("test: parse_hostport/1 - 3~n"),
       {"foo", none} = sipparse_util:parse_hostport("foo."),
       %% IPv4 host and port
       io:format("test: parse_hostport/1 - 4~n"),
  -    {"1.1.1.1", "42"} = sipparse_util:parse_hostport("1.1.1.1:42"),
  +    {"1.1.1.1", 42} = sipparse_util:parse_hostport("1.1.1.1:42"),
       %% IPv4 host and no port
       io:format("test: parse_hostport/1 - 5~n"),
       {"1.1.1.1", none} = sipparse_util:parse_hostport("1.1.1.1"),
       %% IPv6 host and port
       io:format("test: parse_hostport/1 - 6~n"),
  -    {"[1:2:3:4:5:6:7:8]", "42"} = sipparse_util:parse_hostport("[1:2:3:4:5:6:7:8]:42"),
  +    {"[1:2:3:4:5:6:7:8]", 42} = sipparse_util:parse_hostport("[1:2:3:4:5:6:7:8]:42"),
       %% IPv6 host and no port
       io:format("test: parse_hostport/1 - 7~n"),
       {"[1:2:3:4:5:6:7:8]", none} = sipparse_util:parse_hostport("[1:2:3:4:5:6:7:8]"),
  
positive.code: 
  parse_ipv6hostport([91 | IPv6Hostport]) ->	%% 91 is $[
      {IPv6Ref, Port} = get_ipv6ref_and_port(IPv6Hostport),
      case Port of
  	none -> ok;
  	_ -> 
  	    %% throw if not a numeric string
  	    list_to_integer(Port)
      end,
      %% throw if not ip6 ref
      is_IPv6reference(IPv6Ref),
      {ok, "[" ++ IPv6Ref ++ "]", Port};
  parse_ipv6hostport(In) ->
      %% throw if not ip6 ref
  
negative.code: 	{Host, PortRest} ->
  	    %% a style "[...]:Port"
  	    [$: | Port] = PortRest,
  	    {Host, list_to_integer(Port)}
      end.
  
  
  parse_ipv4hostport(HostPort) ->
      case sipparse_util:split_fields(HostPort, $:) of
  	{Host, Port} ->
  	    %% throw if not a IPv4 address string, or not a numeric port
  	    {ok, is_IPv4address(Host), list_to_integer(Port)};
  	{Host} ->
  	    %% throw if not a IPv4 address string
  	    {ok, is_IPv4address(Host), none}
  