BazelBaseTestCaseTest.java 文件源码

java
阅读 29 收藏 0 点赞 0 评论 0

项目:bazel-integration-testing 作者:
private TypeSafeDiagnosingMatcher<Integer> successfulExitCode(
    final Command cmd, final File workspace) {
  return new TypeSafeDiagnosingMatcher<Integer>() {
    @Override
    protected boolean matchesSafely(
        final Integer exitCode, final Description mismatchDescription) {
      if (exitCode != 0) {
        mismatchDescription
            .appendText(" exit code was ")
            .appendValue(exitCode)
            .appendText("\n")
            .appendText("Workspace contents: \n")
            .appendValueList("", "\n", "\n", contents(workspace.toPath()))
            .appendDescriptionOf(commandDescription(cmd));
        return false;
      }
      return true;
    }

    @Override
    public void describeTo(final Description description) {
      description.appendText("successful exit code (0)");
    }
  };
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号