aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_dispatcher.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-03-21 22:18:24 +0100
committerLoïc Hoguin <[email protected]>2011-03-21 22:18:24 +0100
commit0b13835bfea9107773ee06ae5914998d20ca7477 (patch)
treeaf5c5760dc6a73155d8a7acd0e2a342595537fe0 /src/cowboy_dispatcher.erl
parent8e55c2e2b897322f0d995117efe31b25c9c55cda (diff)
downloadcowboy-0b13835bfea9107773ee06ae5914998d20ca7477.tar.gz
cowboy-0b13835bfea9107773ee06ae5914998d20ca7477.tar.bz2
cowboy-0b13835bfea9107773ee06ae5914998d20ca7477.zip
Fix tests for cowboy_dispatcher:split_path/1.
Diffstat (limited to 'src/cowboy_dispatcher.erl')
-rw-r--r--src/cowboy_dispatcher.erl18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/cowboy_dispatcher.erl b/src/cowboy_dispatcher.erl
index eb2355a..8370d31 100644
--- a/src/cowboy_dispatcher.erl
+++ b/src/cowboy_dispatcher.erl
@@ -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 = [