Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N5URI containerPath behavior #121

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: normalize file paths before asserting
  • Loading branch information
bogovicj committed Apr 25, 2024
commit 2b5e25b4aca371681778a8c3b84f559b76af9955
9 changes: 6 additions & 3 deletions src/test/java/org/janelia/saalfeldlab/n5/N5URLTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import org.junit.Test;

import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Paths;

Expand Down Expand Up @@ -116,7 +118,7 @@ public void testGetRelative() throws URISyntaxException {
}

@Test
public void testContainerPath() throws URISyntaxException {
public void testContainerPath() throws URISyntaxException, IOException {

final String home = System.getProperty("user.home");
// final String posixPath = "/a/b/c/d?e#f";
Expand All @@ -126,10 +128,11 @@ public void testContainerPath() throws URISyntaxException {
// "/a/b/c/d",
// N5URI.from(posixPath).getContainerPath());

// normalize with File
final N5URI systemUri = N5URI.from(systemPath);
assertEquals(
Paths.get(home).toUri().toString(),
systemUri.getContainerPath());
Paths.get(home).toFile().getCanonicalPath(),
new File(systemUri.getContainerPath()).getCanonicalPath());

}

Expand Down
Loading