mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 20:30:23 +00:00
Fix tests for cowboy_dispatcher:split_path/1.
This commit is contained in:
parent
8e55c2e2b8
commit
0b13835bfe
1 changed files with 9 additions and 9 deletions
|
@ -121,17 +121,17 @@ split_host_test_() ->
|
||||||
split_path_test_() ->
|
split_path_test_() ->
|
||||||
%% {Path, Result, QueryString}
|
%% {Path, Result, QueryString}
|
||||||
Tests = [
|
Tests = [
|
||||||
{"?", [], []},
|
{"?", [], "", ""},
|
||||||
{"???", [], "??"},
|
{"???", [], "", "??"},
|
||||||
{"/", [], []},
|
{"/", [], "/", ""},
|
||||||
{"/users", ["users"], []},
|
{"/users", ["users"], "/users", ""},
|
||||||
{"/users?", ["users"], []},
|
{"/users?", ["users"], "/users", ""},
|
||||||
{"/users?a", ["users"], "a"},
|
{"/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"], "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, RawP, Qs} = split_path(P) end} || {P, R, RawP, Qs} <- Tests].
|
||||||
++ [{P, fun() -> {R, Qs} = split_path(P) end} || {P, R, Qs} <- Tests].
|
|
||||||
|
|
||||||
match_test_() ->
|
match_test_() ->
|
||||||
Dispatch = [
|
Dispatch = [
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue