Fix root path test and add more test cases
This commit is contained in:
@@ -190,13 +190,13 @@ class DefaultPathSegmentContainer implements PathSegmentContainer {
|
||||
}
|
||||
|
||||
static PathSegmentContainer subPath(PathSegmentContainer container, int fromIndex, int toIndex) {
|
||||
if (fromIndex == toIndex) {
|
||||
return EMPTY_PATH;
|
||||
}
|
||||
List<PathSegment> segments = container.pathSegments();
|
||||
if (fromIndex == 0 && toIndex == segments.size()) {
|
||||
return container;
|
||||
}
|
||||
if (fromIndex == toIndex) {
|
||||
return EMPTY_PATH;
|
||||
}
|
||||
|
||||
Assert.isTrue(fromIndex < toIndex, "fromIndex: " + fromIndex + " should be < toIndex " + toIndex);
|
||||
Assert.isTrue(fromIndex >= 0 && fromIndex < segments.size(), "Invalid fromIndex: " + fromIndex);
|
||||
|
||||
Reference in New Issue
Block a user