use of com.facebook.buck.versions.TargetNodeTranslator in project buck by facebook.
the class SourceListTest method translatedNamedSourcesTargets.
@Test
public void translatedNamedSourcesTargets() {
BuildTarget target = BuildTargetFactory.newInstance("//:rule");
BuildTarget newTarget = BuildTargetFactory.newInstance("//something:else");
TargetNodeTranslator translator = new FixedTargetNodeTranslator(ImmutableMap.of(target, newTarget));
assertThat(translator.translate(CELL_PATH_RESOLVER, PATTERN, SourceList.ofNamedSources(ImmutableSortedMap.of("name", new DefaultBuildTargetSourcePath(target)))), Matchers.equalTo(Optional.of(SourceList.ofNamedSources(ImmutableSortedMap.of("name", new DefaultBuildTargetSourcePath(newTarget))))));
}
use of com.facebook.buck.versions.TargetNodeTranslator in project buck by facebook.
the class NeededCoverageSpecTest method untranslatedTargets.
@Test
public void untranslatedTargets() {
BuildTarget target = BuildTargetFactory.newInstance("//:rule");
TargetNodeTranslator translator = new FixedTargetNodeTranslator(ImmutableMap.of());
NeededCoverageSpec spec = NeededCoverageSpec.of(1.0f, target, Optional.empty());
assertThat(translator.translate(CELL_PATH_RESOLVER, PATTERN, spec), Matchers.equalTo(Optional.empty()));
}
Aggregations