aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/com/google/devtools/build')
-rw-r--r--src/test/java/com/google/devtools/build/lib/vfs/RootTest.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/vfs/RootTest.java b/src/test/java/com/google/devtools/build/lib/vfs/RootTest.java
index dd0f611b1a..640f8c4c91 100644
--- a/src/test/java/com/google/devtools/build/lib/vfs/RootTest.java
+++ b/src/test/java/com/google/devtools/build/lib/vfs/RootTest.java
@@ -67,6 +67,16 @@ public class RootTest {
}
@Test
+ public void testFilesystemTransform() throws Exception {
+ FileSystem fs2 = new InMemoryFileSystem(BlazeClock.instance());
+ Root root = Root.fromPath(fs.getPath("/foo"));
+ Root root2 = Root.toFileSystem(root, fs2);
+ assertThat(root2.asPath().getFileSystem()).isSameAs(fs2);
+ assertThat(root2.asPath().asFragment()).isEqualTo(PathFragment.create("/foo"));
+ assertThat(root.isAbsolute()).isFalse();
+ }
+
+ @Test
public void testFileSystemAbsoluteRoot() throws Exception {
Root root = Root.absoluteRoot(fs);
assertThat(root.asPath()).isNull();