diff options
author | 2018-06-06 19:31:23 -0700 | |
---|---|---|
committer | 2018-06-06 19:32:38 -0700 | |
commit | 89d85ea3c515cb288a388d89673e773f6806d7fa (patch) | |
tree | 2cff8b9d8f912f7a70f180be9310e7d8a6831bbb /src/test/java/com/google/devtools/build | |
parent | ccaccb2b277a82f7264567563a02ab133a0f6e6f (diff) |
Allow for Path and Root resolution when extracting action metadata.
RELNOTES: None
PiperOrigin-RevId: 199572597
Diffstat (limited to 'src/test/java/com/google/devtools/build')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/vfs/RootTest.java | 10 |
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(); |