Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added test cases.

  • Loading branch information...
commit 6abc02a22edeb518c840763fd291c69549be97de 1 parent 00c152b
@saleyn saleyn authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 test/eunit/cookies.erl
View
16 test/eunit/cookies.erl
@@ -305,6 +305,22 @@ real_setcookies_test() ->
?assertEqual(ok, parse_set_cookies(Io, file:read_line(Io), 1)),
ok.
+set_cookie_test() ->
+ ?assertEqual(
+ "a=bcd; Version=1; Comment=OK; Max-Age=1; "
+ "Expires=Tue, 03 Jan 2012 10:00:05 GMT; HttpOnly; Secure",
+ begin
+ {header, {set_cookie, L}} = yaws_api:set_cookie("a", "bcd",
+ [{expires, {{2012,1,3},{10,0,5}}},
+ {max_age, 1}, secure, http_only, {comment, "OK"}]),
+ lists:flatten(L)
+ end),
+ ?assertEqual(
+ "a=bcd; Version=1",
+ begin
+ {header, {set_cookie, L}} = yaws_api:set_cookie("a", "bcd", []),
+ lists:flatten(L)
+ end).
parse_cookies(Io, eof, _) ->
file:close(Io),
Please sign in to comment.
Something went wrong with that request. Please try again.