Skip to content

Commit

Permalink
Adding URIUtil.addPath() test to show file+str behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
joakime committed Sep 13, 2022
1 parent 141c582 commit 0d08f37
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,12 @@ public void testAddPathNav()
// java.net.URI will encode `\\` to `%5C` per URI rules
actual = URIUtil.addPath(uri, "foo/..\\bar");
assertThat(actual.toASCIIString(), is("file:////c:/foo/..%5Cbar"));

// java.net.URI will encode `\\` to `%5C` per URI rules
uri = URI.create("file:///opt/foo.txt");
actual = URIUtil.addPath(uri, "bar.dat");
assertThat(actual.toASCIIString(), is("file:///opt/foo.txt/bar.dat"));

}

public static Stream<Arguments> ensureSafeEncodingSource()
Expand Down

0 comments on commit 0d08f37

Please sign in to comment.