/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ca.mcmaster.cas.matlab2smt;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.junit.Assert.*;

/**
 *
 * @author matthew
 */
@RunWith(JUnit4.class)
public class CVC3GeneratorTest {
    /**
     * Test of addition operation.
     */
    @Test
    public void testAdditionOpConverstion() {
        MatlabBinaryOperation op = MatlabBinaryOperation.Addition;
        assertEquals("+", CVC3Generator.ConvertToOutputOp(op, new RealVariableType()));
        assertEquals("BVPLUS(13,", CVC3Generator.ConvertToOutputOp(op, new FixedPointVariableType(true, 13, 5)));
    }
    /**
     * Test of literals containing decimals.
     *
     * All decimals must be represented as fractions.  Ensure that this happens.
     */
    @Test
    public void testLiteralRationalsAreFractions() {
        MatlabLiteral literal = new MatlabLiteral("4.56");
        assertEquals("(456/100)", literal.getCheckerOutput(new CVC3Generator(), new RealVariableType()));
    }
}
