Skip to content

Commit

Permalink
Automatic code cleanup.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 248529651
  • Loading branch information
cpovirk authored and copybara-github committed May 16, 2019
1 parent 43532f9 commit 62261bf
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
package com.google.devtools.build.skyframe;

import static com.google.common.truth.Fact.simpleFact;
import static com.google.common.truth.Truth.assertWithMessage;
import static com.google.devtools.build.skyframe.ErrorInfoSubjectFactory.assertThatErrorInfo;

import com.google.common.collect.ImmutableList;
import com.google.common.truth.FailureMetadata;
Expand Down Expand Up @@ -48,20 +46,22 @@ public void hasNoError() {
}

public Subject<?, ?> hasEntryThat(SkyKey key) {
return assertWithMessage("Entry for " + actualAsString()).that(actual.get(key));
return check("get(%s)", key).that(actual.get(key));
}

public ErrorInfoSubject hasErrorEntryForKeyThat(SkyKey key) {
return assertThatErrorInfo(actual.getError(key)).named("Error entry for " + actualAsString());
return check("getError(%s)", key)
.about(new ErrorInfoSubjectFactory())
.that(actual.getError(key));
}

public IterableSubject hasDirectDepsInGraphThat(SkyKey parent) throws InterruptedException {
return assertWithMessage("Direct deps for " + parent + " in " + actualAsString())
return check("directDeps(%s)", parent)
.that(actual.getWalkableGraph().getDirectDeps(ImmutableList.of(parent)).get(parent));
}

public IterableSubject hasReverseDepsInGraphThat(SkyKey child) throws InterruptedException {
return assertWithMessage("Reverse deps for " + child + " in " + actualAsString())
return check("reverseDeps(%s)", child)
.that(actual.getWalkableGraph().getReverseDeps(ImmutableList.of(child)).get(child));
}
}

0 comments on commit 62261bf

Please sign in to comment.