diff options
author | Loïc Hoguin <[email protected]> | 2011-03-21 22:18:24 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2011-03-21 22:18:24 +0100 |
commit | 0b13835bfea9107773ee06ae5914998d20ca7477 (patch) | |
tree | af5c5760dc6a73155d8a7acd0e2a342595537fe0 | |
parent | 8e55c2e2b897322f0d995117efe31b25c9c55cda (diff) | |
download | cowboy-0b13835bfea9107773ee06ae5914998d20ca7477.tar.gz cowboy-0b13835bfea9107773ee06ae5914998d20ca7477.tar.bz2 cowboy-0b13835bfea9107773ee06ae5914998d20ca7477.zip |
Fix tests for cowboy_dispatcher:split_path/1.
-rw-r--r-- | src/cowboy_dispatcher.erl | 18 |
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 = [ |