Browse Source

Fix tests for cowboy_dispatcher:split_path/1.

Loïc Hoguin 14 years ago
parent
commit
0b13835bfe
1 changed files with 9 additions and 9 deletions
  1. 9 9
      src/cowboy_dispatcher.erl

+ 9 - 9
src/cowboy_dispatcher.erl

@@ -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?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"], "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_() ->
 match_test_() ->
 	Dispatch = [
 	Dispatch = [