0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

Fix tests for cowboy_dispatcher:split_path/1.

This commit is contained in:
Loïc Hoguin 2011-03-21 22:18:24 +01:00
parent 8e55c2e2b8
commit 0b13835bfe

View file

@ -121,17 +121,17 @@ split_host_test_() ->
split_path_test_() ->
%% {Path, Result, QueryString}
Tests = [
{"?", [], []},
{"???", [], "??"},
{"/", [], []},
{"/users", ["users"], []},
{"/users?", ["users"], []},
{"/users?a", ["users"], "a"},
{"?", [], "", ""},
{"???", [], "", "??"},
{"/", [], "/", ""},
{"/users", ["users"], "/users", ""},
{"/users?", ["users"], "/users", ""},
{"/users?a", ["users"], "/users", "a"},
{"/users/42/friends?a=b&c=d&e=notsure?whatever",
["users", "42", "friends"], "a=b&c=d&e=notsure?whatever"}
["users", "42", "friends"],
"/users/42/friends", "a=b&c=d&e=notsure?whatever"}
],
[{"atom '*'", fun() -> {'*', []} = split_path('*') end}]
++ [{P, fun() -> {R, Qs} = split_path(P) end} || {P, R, Qs} <- Tests].
[{P, fun() -> {R, RawP, Qs} = split_path(P) end} || {P, R, RawP, Qs} <- Tests].
match_test_() ->
Dispatch = [