use of uk.me.parabola.mkgmap.osmstyle.eval.Op in project mkgmap by openstreetmap.
the class ExpressionArrangerTest method testExitsAndFunction.
@Test
public void testExitsAndFunction() {
Op op = createOp("$a=* & is_closed()=true {name 'n466'} [0x2]");
System.out.println(fmtExpr(op));
op = arranger.arrange(op);
System.out.println(fmtExpr(op));
assertTrue(isSolved(op));
assertTrue(op.getFirst().getType() != NodeType.FUNCTION);
}
use of uk.me.parabola.mkgmap.osmstyle.eval.Op in project mkgmap by openstreetmap.
the class ExpressionArrangerTest method testBasicOr.
@Test
public void testBasicOr() {
Op op = createOp("a<2 & b=1 | a<1 & b=2");
op = arranger.arrange(op);
assertTrue(isSolved(op));
}
use of uk.me.parabola.mkgmap.osmstyle.eval.Op in project mkgmap by openstreetmap.
the class ExpressionArrangerTest method testOrWithNotFailure.
@Test
public void testOrWithNotFailure() {
Op op = createOp("$b<2 | !($b!=1 & $b!=2) | $a~1 {name 'n466'} [0x2]");
System.out.println(fmtExpr(op));
op = arranger.arrange(op);
System.out.println(fmtExpr(op));
assertTrue(isSolved(op));
}
use of uk.me.parabola.mkgmap.osmstyle.eval.Op in project mkgmap by openstreetmap.
the class ExpressionArrangerTest method testComplex1.
@Test
public void testComplex1() {
Op op = createOp("($a=2 | $b~2 | $a=2 | $a<1) & ($a!=1 | $b<2 | !($a=1) | $b=1) & $b!=1 {name 'n866'} [0x2]");
op = arranger.arrange(op);
assertTrue(isSolved(op));
}
use of uk.me.parabola.mkgmap.osmstyle.eval.Op in project mkgmap by openstreetmap.
the class ExpressionArrangerTest method testPrepareOrSimple.
@Test
public void testPrepareOrSimple() {
// Just one or
Op op = createOp("a=3 | b < 2");
op = arranger.arrange(op);
Iterator<Op> it = arranger.prepareForSave(op);
boolean first = true;
while (it.hasNext()) {
Op o = it.next();
assertTrue("Prepared OR should all be LinkedOp's", o instanceof LinkedOp);
assertEquals("Only first should have first flag set", first, ((LinkedOp) o).isFirstPart());
first = false;
assertTrue(isSolved(o));
System.out.println(o);
}
}
Aggregations