Fix root path test and add more test cases

This commit is contained in:
Rossen Stoyanchev
2017-06-15 16:14:12 -04:00
parent 67e482aaf8
commit 4a21fb27fc
3 changed files with 10 additions and 3 deletions

View File

@@ -130,6 +130,10 @@ public class DefaultPathSegmentContainerTests {
assertEquals("/b/c", PathSegmentContainer.subPath(path, 1).value());
assertEquals("/c", PathSegmentContainer.subPath(path, 2).value());
// root path
path = PathSegmentContainer.parse("/", UTF_8);
assertEquals("/", PathSegmentContainer.subPath(path, 0).value());
// trailing slash
path = PathSegmentContainer.parse("/a/b/", UTF_8);
assertEquals("/b/", PathSegmentContainer.subPath(path, 1).value());

View File

@@ -39,6 +39,9 @@ public class DefaultRequestPathTests {
// context path only
testRequestPath("/a/b", "/a/b", "", false, true, false);
// root path
testRequestPath("/", "", "/", false, true, false);
// empty path
testRequestPath("", "", "", true, false, false);
testRequestPath("", "/", "", true, false, false);