aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/vfs/GlobTest.java
diff options
context:
space:
mode:
authorGravatar Carmi Grushko <carmi@google.com>2015-11-10 17:19:13 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2015-11-11 13:07:36 +0000
commitfd8acab0fcd4586c7beab61145cc565701bc3009 (patch)
tree8ef529e52d7106e86d2c4f9aa6d50a86e46575d7 /src/test/java/com/google/devtools/build/lib/vfs/GlobTest.java
parent254024df7c4a655a269e3e49c0a600716f1aedee (diff)
Replace home-made assertions with equivalent Google Truth calls.
-- MOS_MIGRATED_REVID=107492955
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/vfs/GlobTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/vfs/GlobTest.java42
1 files changed, 28 insertions, 14 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/vfs/GlobTest.java b/src/test/java/com/google/devtools/build/lib/vfs/GlobTest.java
index 2b54531b8b..e99895c69f 100644
--- a/src/test/java/com/google/devtools/build/lib/vfs/GlobTest.java
+++ b/src/test/java/com/google/devtools/build/lib/vfs/GlobTest.java
@@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.common.collect.Ordering;
import com.google.common.util.concurrent.Uninterruptibles;
-import com.google.devtools.build.lib.testutil.MoreAsserts;
import com.google.devtools.build.lib.testutil.TestUtils;
import com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem;
@@ -228,11 +227,12 @@ public class GlobTest {
Collection<String> excludes,
String... expecteds)
throws Exception {
- MoreAsserts.assertSameContents(resolvePaths(expecteds),
- new UnixGlob.Builder(tmpPath)
- .addPatterns(pattern)
- .addExcludes(excludes)
- .globInterruptible());
+ assertThat(
+ new UnixGlob.Builder(tmpPath)
+ .addPatterns(pattern)
+ .addExcludes(excludes)
+ .globInterruptible())
+ .containsExactlyElementsIn(resolvePaths(expecteds));
}
private Set<Path> resolvePaths(String... relativePaths) {
@@ -260,11 +260,12 @@ public class GlobTest {
}
};
- MoreAsserts.assertSameContents(ImmutableList.of(tmpPath.getRelative("foo/bar/wiz/file")),
- new UnixGlob.Builder(tmpPath)
- .addPattern("foo/bar/wiz/file")
- .setFilesystemCalls(new AtomicReference<>(syscalls))
- .glob());
+ assertThat(
+ new UnixGlob.Builder(tmpPath)
+ .addPattern("foo/bar/wiz/file")
+ .setFilesystemCalls(new AtomicReference<>(syscalls))
+ .glob())
+ .containsExactlyElementsIn(ImmutableList.of(tmpPath.getRelative("foo/bar/wiz/file")));
}
@Test
@@ -455,9 +456,22 @@ public class GlobTest {
// In the non-interruptible case, the interrupt bit should be set, but the
// glob should return the correct set of full results.
assertTrue(Thread.interrupted());
- MoreAsserts.assertSameContents(resolvePaths(".", "foo", "foo/bar", "foo/bar/wiz",
- "foo/bar/wiz/file", "foo/barnacle", "foo/barnacle/wiz", "food", "food/barnacle",
- "food/barnacle/wiz", "fool", "fool/barnacle", "fool/barnacle/wiz"), result);
+ assertThat(result)
+ .containsExactlyElementsIn(
+ resolvePaths(
+ ".",
+ "foo",
+ "foo/bar",
+ "foo/bar/wiz",
+ "foo/bar/wiz/file",
+ "foo/barnacle",
+ "foo/barnacle/wiz",
+ "food",
+ "food/barnacle",
+ "food/barnacle/wiz",
+ "fool",
+ "fool/barnacle",
+ "fool/barnacle/wiz"));
assertFalse(executor.isShutdown());
executor.shutdown();