use of org.abs_models.frontend.ast.Feature in project abstools by abstools.
the class ProductDeclarationTest method productDifference.
@Test
public void productDifference() throws WrongProgramArgumentException {
Model model = assertParse("product P1 = {F1, F2, F3, F4} - {F2, F3};");
model.evaluateAllProductDeclarations();
ProductDecl p = model.findProduct("P1");
Product impl = p.getProduct();
assertEquals(2, impl.getNumFeature());
Set<String> expected = new HashSet<>(Arrays.asList("F1", "F4"));
Set<String> actual = new HashSet<>();
for (Feature f : impl.getFeatures()) actual.add(f.getName());
assertEquals(expected, actual);
}
Aggregations