anchor.diff:                   try_host_binding(Dispatch, ["foo","quux","bar"],80,["d"],0, RD)).
   
   try_host_binding_wildcard_token_order_test() ->
  -    RD = testing,
  +    RD = wrq:create('GET', http, {1,1}, "testing", mochiweb_headers:from_list([])),
       Dispatch = [{{['*',"quux","com"],80},[{['*'],x,y}]}],
       ?assertEqual({x,y,["foo","bar","baz"],80,[],[],".",""},
                    dispatch("foo.bar.baz.quux.com","/",Dispatch,RD)).
  
positive.code:                      true -> 1;
                       _ -> 0
                   end,
      {Host, Port} = split_host_port(HostAsString),
      try_host_binding(DispatchList, Host, Port, Path, ExtraDepth, RD).
  
  split_host_port(HostAsString) ->
      case string:tokens(HostAsString, ":") of
          [HostPart, PortPart] ->
              {split_host(HostPart), list_to_integer(PortPart)};
          [HostPart] ->
              {split_host(HostPart), 80};
          [] ->
              %% no host header
              {[], 80}
      end.
  
  split_host(HostAsString) ->
      string:tokens(HostAsString, ".").
  
  %% @type matchterm() = hostmatchterm() | pathmatchterm().
  % The dispatch configuration is a list of these terms, and the
  
negative.code:                  try_host_binding([], ["bar","foo"], 1234, ["x","y","z"], 0, RD)).
  
  dispatch_test() ->
      RD = wrq:create('GET', http, {1,1}, "testing", mochiweb_headers:from_list([])),
      TrueFun = fun(_) -> true end,
      FalseFun = fun(_) -> false end,
  
  