aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com
diff options
context:
space:
mode:
authorGravatar tomlu <tomlu@google.com>2017-12-14 12:37:58 -0500
committerGravatar John Cater <jcater@google.com>2017-12-14 12:40:27 -0500
commit8b3ba50246fed6ff13d70299fb039cc66be465c4 (patch)
treeba0dc049c248529b464fa0af91267dc59a3f29fe /src/test/java/com
parente6863e2336f3aacac8181394f5edd92cac9471a9 (diff)
Move msys path support into DependencySet, removing it from the general Path system.
This is the only place that should actually need it. PiperOrigin-RevId: 179054861
Diffstat (limited to 'src/test/java/com')
-rw-r--r--src/test/java/com/google/devtools/build/lib/util/DependencySetWindowsTest.java4
-rw-r--r--src/test/java/com/google/devtools/build/lib/windows/PathWindowsTest.java54
2 files changed, 2 insertions, 56 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/util/DependencySetWindowsTest.java b/src/test/java/com/google/devtools/build/lib/util/DependencySetWindowsTest.java
index c0099d2fe3..d4a079db94 100644
--- a/src/test/java/com/google/devtools/build/lib/util/DependencySetWindowsTest.java
+++ b/src/test/java/com/google/devtools/build/lib/util/DependencySetWindowsTest.java
@@ -79,8 +79,8 @@ public class DependencySetWindowsTest {
Set<Path> expected = Sets.newHashSet(
root.getRelative("cpp/hello-lib.cc"),
root.getRelative("cpp/hello-lib.h"),
- fileSystem.getPath("/mingw/include/stdio.h"),
- fileSystem.getPath("/mingw/include/_mingw.h"),
+ fileSystem.getPath("C:/fake/msys/mingw/include/stdio.h"),
+ fileSystem.getPath("C:/fake/msys/mingw/include/_mingw.h"),
fileSystem.getPath("C:/Program Files (x86)/LLVM/lib/clang/3.5.0/include/stddef.h"),
fileSystem.getPath("C:/Program Files (x86)/LLVM/lib/clang/3.5.0/include/stdarg.h"));
diff --git a/src/test/java/com/google/devtools/build/lib/windows/PathWindowsTest.java b/src/test/java/com/google/devtools/build/lib/windows/PathWindowsTest.java
index 1bd3779e66..fb3a9aaf2c 100644
--- a/src/test/java/com/google/devtools/build/lib/windows/PathWindowsTest.java
+++ b/src/test/java/com/google/devtools/build/lib/windows/PathWindowsTest.java
@@ -124,29 +124,10 @@ public class PathWindowsTest {
}
@Test
- public void testAbsoluteUnixPathIsRelativeToWindowsUnixRoot() {
- Path actual = root.getRelative("/foo/bar");
- Path expected = root.getRelative("C:/fake/msys/foo/bar");
- assertThat(actual.getPathString()).isEqualTo(expected.getPathString());
- assertThat(actual).isEqualTo(expected);
- }
-
- @Test
- public void testAbsoluteUnixPathReferringToDriveIsRecognized() {
- Path actual = root.getRelative("/c/foo");
- Path expected = root.getRelative("C:/foo");
- Path weird = root.getRelative("/c:");
- assertThat(actual.getPathString()).isEqualTo(expected.getPathString());
- assertThat(actual).isEqualTo(expected);
- assertThat(weird).isNotEqualTo(expected);
- }
-
- @Test
public void testStartsWithWorksOnWindows() {
assertStartsWithReturnsOnWindows(true, "C:/first/x", "C:/first/x/y");
assertStartsWithReturnsOnWindows(true, "c:/first/x", "C:/FIRST/X/Y");
assertStartsWithReturnsOnWindows(true, "C:/FIRST/X", "c:/first/x/y");
- assertStartsWithReturnsOnWindows(true, "/", "C:/");
assertStartsWithReturnsOnWindows(false, "C:/", "/");
assertStartsWithReturnsOnWindows(false, "C:/", "D:/");
assertStartsWithReturnsOnWindows(false, "C:/", "D:/foo");
@@ -168,41 +149,6 @@ public class PathWindowsTest {
}
@Test
- public void testChildRegistrationWithTranslatedPaths() {
- // Ensure the Path to "/usr" (actually "C:/fake/msys/usr") is created, path parents/children
- // properly registered.
- WindowsPath usrPath = (WindowsPath) root.getRelative("/usr");
- root.getRelative("dummy_path");
-
- // Assert that "usr" is not registered as a child of "/".
- final List<String> children = new ArrayList<>(2);
- root.applyToChildren(
- new Predicate<Path>() {
- @Override
- public boolean apply(Path input) {
- children.add(input.getPathString());
- return true;
- }
- });
- assertThat(children).containsAllOf("C:/fake", "C:/dummy_path");
-
- // Assert that "usr" is registered as a child of "C:/fake/msys/".
- children.clear();
- ((WindowsPath) root.getRelative("C:/fake/msys"))
- .applyToChildren(
- new Predicate<Path>() {
- @Override
- public boolean apply(Path input) {
- children.add(input.getPathString());
- return true;
- }
- });
- assertThat(children).containsExactly("C:/fake/msys/usr");
-
- assertThat(usrPath).isEqualTo(root.getRelative("C:/fake/msys/usr"));
- }
-
- @Test
public void testResolvesShortenedPaths() {
shortPathResolver.resolutions.put("d:/progra~1", "program files");
shortPathResolver.resolutions.put("d:/program files/micros~1", "microsoft something");