@@ -180,10 +180,23 @@ public void testMultipleDataDirs() {
180180 public void testNormalizePath () {
181181 var tree = accessTree (entitlement ("foo/../bar" , "read" ));
182182 assertThat (tree .canRead (path ("foo/../bar" )), is (true ));
183+ assertThat (tree .canRead (path ("foo/../bar/" )), is (true ));
183184 assertThat (tree .canRead (path ("foo" )), is (false ));
184185 assertThat (tree .canRead (path ("" )), is (false ));
185186 }
186187
188+ public void testNormalizeTrailingSlashes () {
189+ var tree = accessTree (entitlement ("/trailing/slash/" , "read" , "/no/trailing/slash" , "read" ));
190+ assertThat (tree .canRead (path ("/trailing/slash" )), is (true ));
191+ assertThat (tree .canRead (path ("/trailing/slash/" )), is (true ));
192+ assertThat (tree .canRead (path ("/trailing/slash.xml" )), is (false ));
193+ assertThat (tree .canRead (path ("/trailing/slash/file.xml" )), is (true ));
194+ assertThat (tree .canRead (path ("/no/trailing/slash" )), is (true ));
195+ assertThat (tree .canRead (path ("/no/trailing/slash/" )), is (true ));
196+ assertThat (tree .canRead (path ("/no/trailing/slash.xml" )), is (false ));
197+ assertThat (tree .canRead (path ("/no/trailing/slash/file.xml" )), is (true ));
198+ }
199+
187200 public void testForwardSlashes () {
188201 String sep = getDefaultFileSystem ().getSeparator ();
189202 var tree = accessTree (entitlement ("a/b" , "read" , "m" + sep + "n" , "read" ));
0 commit comments