aboutsummaryrefslogtreecommitdiff
path: root/jimfs/src/test/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'jimfs/src/test/java/com')
-rw-r--r--jimfs/src/test/java/com/google/common/jimfs/DirectoryTest.java2
-rw-r--r--jimfs/src/test/java/com/google/common/jimfs/JimfsPathTest.java11
2 files changed, 12 insertions, 1 deletions
diff --git a/jimfs/src/test/java/com/google/common/jimfs/DirectoryTest.java b/jimfs/src/test/java/com/google/common/jimfs/DirectoryTest.java
index 217509d..1fee1e5 100644
--- a/jimfs/src/test/java/com/google/common/jimfs/DirectoryTest.java
+++ b/jimfs/src/test/java/com/google/common/jimfs/DirectoryTest.java
@@ -217,7 +217,7 @@ public class DirectoryTest {
/*
* If we inline this into the assertThat call below, javac resolves it to assertThat(SortedSet),
- * which isn't available publicly. Our @GoogleInternal checks consider that to be an error, even
+ * which isn't available publicly. Our internal build system considers that to be an error, even
* though the code will compile fine externally by resolving to assertThat(Iterable) instead. So
* we avoid that by assigning to a non-SortedSet type here.
*/
diff --git a/jimfs/src/test/java/com/google/common/jimfs/JimfsPathTest.java b/jimfs/src/test/java/com/google/common/jimfs/JimfsPathTest.java
index da7d43c..5b59081 100644
--- a/jimfs/src/test/java/com/google/common/jimfs/JimfsPathTest.java
+++ b/jimfs/src/test/java/com/google/common/jimfs/JimfsPathTest.java
@@ -219,6 +219,17 @@ public class JimfsPathTest {
}
@Test
+ public void testResolveName_againstEmptyPath() {
+ // resolve(Name) is only used in the DirectoryStream implementation, so it's only used to
+ // resolve the names of real existing files against some base directory's path. The base
+ // directory path could be the working directory path (i.e. just an empty string), in which case
+ // we need to be sure to return a path that is just the name of the file as opposed a path with
+ // two names, one being the empty string and the other the file name).
+ // See https://github.com/google/jimfs/issues/105
+ assertPathEquals("foo", pathService.emptyPath().resolve(Name.simple("foo")));
+ }
+
+ @Test
public void testResolveSibling_givenEmptyPath() {
Path path = pathService.parsePath("foo/bar");
Path resolved = path.resolveSibling("");