use of com.google.devtools.build.lib.packages.Attribute in project bazel by bazelbuild.
the class RawAttributeMapperTest method testVisitLabels.
/**
* Tests that RawAttributeMapper can't handle label visitation with configurable attributes.
*/
@Test
public void testVisitLabels() throws Exception {
RawAttributeMapper rawMapper = RawAttributeMapper.of(setupGenRule());
try {
rawMapper.visitLabels(new AttributeMap.AcceptsLabelAttribute() {
@Override
public void acceptLabelAttribute(Label label, Attribute attribute) {
// Nothing to do.
}
});
fail("Expected label visitation to fail since one attribute is configurable");
} catch (IllegalArgumentException e) {
assertThat(e.getCause().getMessage()).contains("SelectorList cannot be cast to java.util.List");
}
}
Aggregations