use of com.google.devtools.build.lib.syntax.SkylarkList in project bazel by bazelbuild.
the class SkylarkRuleContextTest method assertArtifactList.
private void assertArtifactList(Object result, List<String> artifacts) {
assertThat(result).isInstanceOf(SkylarkList.class);
SkylarkList resultList = (SkylarkList) result;
assertEquals(artifacts.size(), resultList.size());
int i = 0;
for (String artifact : artifacts) {
assertEquals(artifact, ((Artifact) resultList.get(i++)).getFilename());
}
}
use of com.google.devtools.build.lib.syntax.SkylarkList in project bazel by bazelbuild.
the class SkylarkRuleContextTest method testFeatures.
@Test
public void testFeatures() throws Exception {
SkylarkRuleContext ruleContext = createRuleContext("//foo:cc_with_features");
Object result = evalRuleContextCode(ruleContext, "ruleContext.features");
assertThat((SkylarkList<?>) result).containsExactly("cc_include_scanning", "f1", "f2");
}
Aggregations