package urban.transformers;
import static org.junit.Assert.*;
import static urban.parser.UrbanParser.parse;
import org.antlr.runtime.RecognitionException;
import org.junit.Test;
import urban.model.Model;
public class AddPinchesModelTransformerTest {
@Test
public void testPinches() throws RecognitionException {
Model m = parse("P(x!1,y!2),P(y!1),P(x!2) <-> P(x!1,y!2),P(y!1),P(x!2) @ 1,2\n").model();
m = new AddPinchesModelTransformer().transform(m);
assertEquals("P(x!1, y!2),P(y!1),P(x!2) <-> P(x!1, y!2),P(y!1),P(x!2) @ 1, 2\n"+
"P(x!1, y!2),P(x!2, y!1) <-> P(x!1, y!2),P(x!2, y!1) @ 1, 2\n",m.toString());
}
@Test
public void testPinches_NoPinch() throws RecognitionException {
Model pre = parse("P(f~0,x!1,y!2),P(f~1,y!1),P(f~0,x!2) <-> P(f~1,x!1,y!2),P(f~1,y!1),P(f~0,x!2) @ 1,2\n").model();
Model post = new AddPinchesModelTransformer().transform(pre);
assertEquals(pre.toString(),post.toString());
}
@Test
public void testPinches2() {
/* m = parse("* 'flip' A(f~0) <-> A(f~1)\n"+
"'bind' A(z),A(z) <-> A(z!1),A(z!1) @ 1,1\n"+
"'bind' A(w),A(z) <-> A(w!1),A(z!1) @ 1,1\n"+
"'bind' A(x),A(y) <-> A(x!1),A(y!1) @ 1,1\n");
FRule rule = m.getFRule("flip");
Collection<FRule> expandBindings = rule.expandBindings(m);
assertEquals(90, expandBindings.size());*/
}
}