aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/windows/PathWindowsTest.java
diff options
context:
space:
mode:
authorGravatar lberki <lberki@google.com>2017-05-30 17:00:48 +0200
committerGravatar László Csomor <laszlocsomor@google.com>2017-05-31 09:18:22 +0200
commit78cfa8d1977036452f45838f739cc53debf8a615 (patch)
tree1a7aa946715e7d1b764955f3ee857ef435295ec0 /src/test/java/com/google/devtools/build/lib/windows/PathWindowsTest.java
parenta1fb6f26cfeaa712f447e5d41d2a98565e9ab478 (diff)
Migrate most of the assertions to Truth that the auto-migration tool did not catch.
IntelliJ's "replace structurally" command was surprisingly useful. RELNOTES: None. PiperOrigin-RevId: 157463734
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/windows/PathWindowsTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/windows/PathWindowsTest.java26
1 files changed, 12 insertions, 14 deletions
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 47dfb23a84..fd787c4c9a 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
@@ -14,8 +14,6 @@
package com.google.devtools.build.lib.windows;
import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
import com.google.common.base.Function;
import com.google.common.base.Predicate;
@@ -77,14 +75,14 @@ public class PathWindowsTest {
}
private void assertAsFragmentWorks(String expected) {
- assertEquals(PathFragment.create(expected), filesystem.getPath(expected).asFragment());
+ assertThat(filesystem.getPath(expected).asFragment()).isEqualTo(PathFragment.create(expected));
}
@Test
public void testWindowsPath() {
Path p = filesystem.getPath("C:/foo/bar");
- assertEquals("C:/foo/bar", p.getPathString());
- assertEquals("C:/foo/bar", p.toString());
+ assertThat(p.getPathString()).isEqualTo("C:/foo/bar");
+ assertThat(p.toString()).isEqualTo("C:/foo/bar");
}
@Test
@@ -99,29 +97,29 @@ public class PathWindowsTest {
@Test
public void testGetRelativeWithFragmentWindows() {
Path dir = filesystem.getPath("C:/first/x");
- assertEquals("C:/first/x/y", dir.getRelative(PathFragment.create("y")).toString());
- assertEquals("C:/first/x/x", dir.getRelative(PathFragment.create("./x")).toString());
- assertEquals("C:/first/y", dir.getRelative(PathFragment.create("../y")).toString());
- assertEquals("C:/first/y", dir.getRelative(PathFragment.create("../y")).toString());
- assertEquals("C:/y", dir.getRelative(PathFragment.create("../../../y")).toString());
+ assertThat(dir.getRelative(PathFragment.create("y")).toString()).isEqualTo("C:/first/x/y");
+ assertThat(dir.getRelative(PathFragment.create("./x")).toString()).isEqualTo("C:/first/x/x");
+ assertThat(dir.getRelative(PathFragment.create("../y")).toString()).isEqualTo("C:/first/y");
+ assertThat(dir.getRelative(PathFragment.create("../y")).toString()).isEqualTo("C:/first/y");
+ assertThat(dir.getRelative(PathFragment.create("../../../y")).toString()).isEqualTo("C:/y");
}
@Test
public void testGetRelativeWithAbsoluteFragmentWindows() {
Path x = filesystem.getPath("C:/first/x");
- assertEquals("C:/x/y", x.getRelative(PathFragment.create("C:/x/y")).toString());
+ assertThat(x.getRelative(PathFragment.create("C:/x/y")).toString()).isEqualTo("C:/x/y");
}
@Test
public void testGetRelativeWithAbsoluteStringWorksWindows() {
Path x = filesystem.getPath("C:/first/x");
- assertEquals("C:/x/y", x.getRelative("C:/x/y").toString());
+ assertThat(x.getRelative("C:/x/y").toString()).isEqualTo("C:/x/y");
}
@Test
public void testParentOfRootIsRootWindows() {
- assertSame(root, root.getRelative(".."));
- assertSame(root.getRelative("dots"), root.getRelative("broken/../../dots"));
+ assertThat(root).isSameAs(root.getRelative(".."));
+ assertThat(root.getRelative("dots")).isSameAs(root.getRelative("broken/../../dots"));
}
@Test