From 9168808782b121271a86344bffc6523855c17fd9 Mon Sep 17 00:00:00 2001 From: markt Date: Fri, 7 Jan 2011 15:16:44 +0000 Subject: [PATCH] Update tests now name only cookies are not accepted by default git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1056344 13f79535-47bb-0310-9956-ffa450edef68 --- test/org/apache/tomcat/util/http/TestCookies.java | 30 +++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/test/org/apache/tomcat/util/http/TestCookies.java b/test/org/apache/tomcat/util/http/TestCookies.java index a8151b3c9..07b70e8a9 100644 --- a/test/org/apache/tomcat/util/http/TestCookies.java +++ b/test/org/apache/tomcat/util/http/TestCookies.java @@ -27,16 +27,16 @@ public class TestCookies extends TestCase { test("foo=bar;a=b;", "foo", "bar", "a", "b"); test("foo=bar;a=b; ", "foo", "bar", "a", "b"); test("foo=bar;a=b; ;", "foo", "bar", "a", "b"); - test("foo=;a=b; ;", "foo", "", "a", "b"); - test("foo;a=b; ;", "foo", "", "a", "b"); + test("foo=;a=b; ;", "a", "b"); + test("foo;a=b; ;", "a", "b"); // v1 test("$Version=1; foo=bar;a=b", "foo", "bar", "a", "b"); // OK test("$Version=1;foo=bar;a=b; ; ", "foo", "bar", "a", "b"); - test("$Version=1;foo=;a=b; ; ", "foo", "", "a", "b"); - test("$Version=1;foo= ;a=b; ; ", "foo", "", "a", "b"); - test("$Version=1;foo;a=b; ; ", "foo", "", "a", "b"); + test("$Version=1;foo=;a=b; ; ", "a", "b"); + test("$Version=1;foo= ;a=b; ; ", "a", "b"); + test("$Version=1;foo;a=b; ; ", "a", "b"); test("$Version=1;foo=\"bar\";a=b; ; ", "foo", "bar", "a", "b"); test("$Version=1;foo=\"bar\";$Domain=apache.org;a=b", "foo", "bar", "a", "b"); @@ -69,26 +69,26 @@ public class TestCookies extends TestCase { test("$Version=1;foo=\"bar\";$Domain=apache.org;$Port=8080;a=b", "foo", "bar", "a", "b"); // Test name-only at the end of the header - test("foo;a=b;bar", "foo", "", "a", "b", "bar", ""); - test("foo;a=b;bar;", "foo", "", "a", "b", "bar", ""); - test("foo;a=b;bar ", "foo", "", "a", "b", "bar", ""); - test("foo;a=b;bar ;", "foo", "", "a", "b", "bar", ""); + test("foo;a=b;bar", "a", "b"); + test("foo;a=b;bar;", "a", "b"); + test("foo;a=b;bar ", "a", "b"); + test("foo;a=b;bar ;", "a", "b"); // Multiple delimiters next to each other // BUG -- the ' ' needs to be skipped. - test("foo;a=b; ;bar", "foo", "", "a", "b", "bar", ""); + test("foo;a=b; ;bar", "a", "b"); // BUG -- ';' needs skipping - test("foo;a=b;;bar", "foo", "", "a", "b", "bar", ""); - test("foo;a=b; ;;bar=rab", "foo", "", "a", "b", "bar", "rab"); + test("foo;a=b;;bar", "a", "b"); + test("foo;a=b; ;;bar=rab", "a", "b", "bar", "rab"); // These pass currently - test("foo;a=b;; ;bar=rab", "foo", "", "a", "b", "bar", "rab"); + test("foo;a=b;; ;bar=rab", "a", "b", "bar", "rab"); // '#' is a valid cookie name (not a separator) - test("foo;a=b;;#;bar=rab","foo", "", "a", "b", "#", "", "bar", "rab"); + test("foo;a=b;;#;bar=rab","a", "b", "bar", "rab"); - test("foo;a=b;;\\;bar=rab", "foo", "", "a", "b", "bar", "rab"); + test("foo;a=b;;\\;bar=rab", "a", "b", "bar", "rab"); // Try all the separators of version1 in version0 cookie. // Won't work we only parse version1 cookie result 1 cookie. -- 2.11.0