From 9cc9f4e1ec44fd737c73c0d3b9bc29274dce64cc Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Wed, 27 Jun 2012 12:41:37 +0900 Subject: [PATCH] Add more cookie decoding test case --- .../netty/handler/codec/http/CookieDecoderTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/codec-http/src/test/java/io/netty/handler/codec/http/CookieDecoderTest.java b/codec-http/src/test/java/io/netty/handler/codec/http/CookieDecoderTest.java index 2055e4994b..9351c9816b 100644 --- a/codec-http/src/test/java/io/netty/handler/codec/http/CookieDecoderTest.java +++ b/codec-http/src/test/java/io/netty/handler/codec/http/CookieDecoderTest.java @@ -391,6 +391,19 @@ public class CookieDecoderTest { assertEquals("", c.getValue()); } + @Test + public void testDecodingValuesWithCommasAndEquals() { + String src = "A=v=1&lg=en-US,it-IT,it&intl=it&np=1;T=z=E"; + Set cookies = CookieDecoder.decode(src); + Iterator i = cookies.iterator(); + Cookie c = i.next(); + assertEquals("A", c.getName()); + assertEquals("v=1&lg=en-US,it-IT,it&intl=it&np=1", c.getValue()); + c = i.next(); + assertEquals("T", c.getName()); + assertEquals("z=E", c.getValue()); + } + @Test public void testDecodingLongValue() { String longValue =