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

java.net.URI.toURI broken #460

Merged
merged 4 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
1 change: 1 addition & 0 deletions output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
After.
Harsh4902 marked this conversation as resolved.
Show resolved Hide resolved
17 changes: 16 additions & 1 deletion src/tests/gov/nasa/jpf/test/java/io/FileTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;

import org.junit.After;
import org.junit.AfterClass;
Expand Down Expand Up @@ -102,5 +104,18 @@ public void testEquals() {
assert file.equals(new Object()) == false;
}
}


@Test
public void testToURI(){
File file = new File("testfile.txt");
URI expectedURI = null;
try {
expectedURI = new File(file.getAbsolutePath()).toURI();
} catch (Exception e) {
Harsh4902 marked this conversation as resolved.
Show resolved Hide resolved
fail("URISyntaxException thrown while constructing expected URI");
}

URI actualURI = file.toURI();
assertEquals("The URIs should be equal",expectedURI,actualURI);
}
}
Loading