diff options
author | 2016-05-18 14:09:43 +0000 | |
---|---|---|
committer | 2016-05-19 16:26:53 +0000 | |
commit | cceeac6e009c856452adb2bb3adfa2663138e5ae (patch) | |
tree | 4711521afa44595258b95a5ee9cf67d881c19990 /src/test/java/com/google/devtools/build/lib/vfs | |
parent | 102a9a101a52f4ca92c9e97387ae159e54e87b05 (diff) |
Fix Windows issue in Path.getRelative, which wasn't handling backslashes.
--
MOS_MIGRATED_REVID=122627792
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/vfs')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/vfs/PathWindowsTest.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/vfs/PathWindowsTest.java b/src/test/java/com/google/devtools/build/lib/vfs/PathWindowsTest.java index 461ce9bc1f..cb8b23b000 100644 --- a/src/test/java/com/google/devtools/build/lib/vfs/PathWindowsTest.java +++ b/src/test/java/com/google/devtools/build/lib/vfs/PathWindowsTest.java @@ -13,6 +13,7 @@ // limitations under the License. package com.google.devtools.build.lib.vfs; +import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertSame; @@ -103,6 +104,13 @@ public class PathWindowsTest { assertStartsWithReturnsOnWindows(true, "C:/FIRST/X", "c:/first/x/y"); } + @Test + public void testGetRelative() { + Path root = filesystem.getPath("C:\\first\\x"); + Path other = root.getRelative("a\\b\\c"); + assertThat(other.asFragment().getPathString()).isEqualTo("C:/first/x/a/b/c"); + } + private void assertStartsWithReturnsOnWindows(boolean expected, String ancestor, String descendant) { |