@Test
public void describeNestedMismatchesNoEllipsisBeforeFirstValue() throws Exception {
Set<String> allKeys = new LinkedHashSet<>(asList("first", "second", "third"));
StringDescription description = new StringDescription();
Map<String, Consumer<Description>> mismatchedKeys =
ImmutableMap.of("first", desc -> desc.appendText("mismatch!"));
BiConsumer<String, Description> describeKey = (str, desc) -> desc.appendText(str);
DescriptionUtils.describeNestedMismatches(allKeys, description, mismatchedKeys, describeKey);
assertThat(description.toString(), is(
"{\n"
+ " first: mismatch!\n"
+ " ...\n"
+ "}"
));
}
DescriptionUtilsTest.java 文件源码
java
阅读 25
收藏 0
点赞 0
评论 0
项目:java-hamcrest
作者:
评论列表
文章目录