示例#1
0
  public final void testMultiplicationBetweenIntegersSimplification() {
    Times times = new Times();
    times.left = new Number(5);
    times.left.type = IntegerType.instance;
    times.right = new Number(2);
    times.right.type = IntegerType.instance;

    expressionSimplificationTester(times, Number.class, IntegerType.instance, 10, true);
  }
示例#2
0
  private void multiplyWithOne(boolean oneOnLeft) {
    Times t = new Times();
    t.type = IntegerType.instance;
    IdExpression id = new IdExpression("mult");
    id.type = IntegerType.instance;
    if (oneOnLeft) {
      t.left = new Number(1);
      t.right = id;
    } else {
      t.right = new Number(1);
      t.left = id;
    }

    IdExpression idExp =
        (IdExpression)
            expressionSimplificationTester(t, IdExpression.class, IntegerType.instance, 0, false);

    assertEquals(idExp.id, id.id);
  }