anchor.diff:                                     {'to', <<"sip:bob@localhost">>}, {'unsupported', <<"bar, baz">>},
                                      {'user-agent', <<"Softphone Beta1.5">>}, {'via', <<"SIP/2.0/UDP localhost">>},
                                      {'warning', <<"307 isi.edu \"Session parameter 'foo' not understood\"">>},
  -
  -
  -                                   {'x-custom-atom', 25},
  -                                   {<<"X-Custom">>, <<"value">>}])),
  +                                   {'www-authenticate', <<"Digest realm=\"atlanta.com\"">>},
  +                                   {'x-custom-atom', 25}, {<<"X-Custom">>, <<"value">>}])),
   
        % Already parsed
        ?_assertEqual({parsed, value}, parse('x-custom2', {parsed, value})),
  
positive.code:                      "To: sip:bob@localhost\r\nUnsupported: bar, baz\r\n",
                       "User-Agent: Softphone Beta1.5\r\nVia: SIP/2.0/UDP localhost\r\n",
                       "Warning: 307 isi.edu \"Session parameter 'foo' not understood\"\r\n",
  
                       "x-custom-atom: 25\r\n",
                       "X-Custom: value\r\n">>,
                     format_headers([{'accept', <<"*/*">>}, {'accept-encoding', <<"identity">>},
                                     {'accept-language', <<"en">>}, {'alert-info', <<"<http://www.example.com/sounds/moo.wav>">>},
                                     {'allow', <<"INVITE">>}, {'authentication-info', <<"nextnonce=\"47364c23432d2e131a5fb210812c\"">>},
  
negative.code:                           [warning(307, <<"isi.edu">>, <<"Session parameter 'foo' not understood">>),
                             warning(301, <<"isi.edu">>, <<"Incompatible network address type 'E.164'">>)])),
  
       % WWW-Authenticate
       ?_assertEqual(auth('Digest',
                          [{realm, <<"atlanta.com">>}, {domain, <<"sip:ss1.carrier.com">>},
                           {nonce, <<"f84f1cec41e6cbe5aea9c8e88d359">>}, {opaque, <<>>},
                           {stale, false}, {algorithm, 'MD5'}, {qop, [auth, 'auth-int']},
                           {param, <<>>}]),
                     parse('www-authenticate',
                           <<"Digest realm=\"atlanta.com\", domain=\"sip:ss1.carrier.com\", ",
                             "nonce=\"f84f1cec41e6cbe5aea9c8e88d359\", opaque=\"\", ",
                             "stale=FALSE, algorithm=MD5, qop=\"auth, auth-int\", ",
                             "param=\"\"">>)),
       ?_assertEqual(<<"Digest realm=\"atlanta.com\", domain=\"sip:ss1.carrier.com\", ",
                       "nonce=\"f84f1cec41e6cbe5aea9c8e88d359\", opaque=\"\", ",
                       "stale=false, algorithm=MD5, qop=\"auth, auth-int\", ",
                       "param=\"\"">>,
                     format('www-authenticate',
                            auth('Digest',
                                 [{realm, <<"atlanta.com">>}, {domain, <<"sip:ss1.carrier.com">>},
                                  {nonce, <<"f84f1cec41e6cbe5aea9c8e88d359">>}, {opaque, <<>>},
                                  {stale, false}, {algorithm, 'MD5'}, {qop, [auth, 'auth-int']},
                                  {param, <<>>}]))),
  
       ?_assertEqual(auth('Digest', [{realm, <<"atlanta.com">>}, {stale, true}]),
                     parse('www-authenticate', <<"Digest realm=\"atlanta.com\", stale=true">>)),
       ?_assertEqual(<<"Digest realm=\"atlanta.com\", stale=true">>,
                     format('www-authenticate', auth('Digest', [{realm, <<"atlanta.com">>}, {stale, true}]))),
  
       % If the URI is not enclosed in angle brackets, any semicolon-delimited
       % parameters are header-parameters, not URI parameters, Section 20.
       ?_assertEqual({address(<<>>, sip_uri:parse(<<"sip:alice@atlanta.com">>), [{param, <<"value">>}]), <<>>},
                     parse_address(<<"sip:alice@atlanta.com;param=value">>, fun parse_generic_param/2))
      ].
  
  