Loading src/main/java/ca/mcmaster/cas/matlab2smt/MatlabLiteral.java 0 → 100644 +29 −0 Original line number Diff line number Diff line /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package ca.mcmaster.cas.matlab2smt; /** * * @author matthew */ public final class MatlabLiteral implements MatlabExpression { public MatlabLiteral(String value) { m_value = value; } @Override public VariableType type() { return m_type; } @Override public String getCVC3Output() { return m_value; } final String m_value; final VariableType m_type = new RealVariableType(); } src/test/java/ca/mcmaster/cas/matlab2smt/MatlabLiteralTest.java 0 → 100644 +44 −0 Original line number Diff line number Diff line /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package ca.mcmaster.cas.matlab2smt; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.*; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; /** * * @author matthew */ @RunWith(JUnit4.class) public class MatlabLiteralTest { /** * Test of type method, of class MatlabLiteral. */ @Test public void testType() { MatlabLiteral instance = new MatlabLiteral(null); VariableType expResult = new RealVariableType(); VariableType result = instance.type(); assertEquals(expResult, result); assertEquals(result, instance.type()); } /** * Test of getCVC3Output method, of class MatlabLiteral. */ @Test public void testGetCVC3Output() { MatlabLiteral instance = new MatlabLiteral("5"); String expResult = "5"; String result = instance.getCVC3Output(); assertEquals(expResult, result); } } Loading
src/main/java/ca/mcmaster/cas/matlab2smt/MatlabLiteral.java 0 → 100644 +29 −0 Original line number Diff line number Diff line /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package ca.mcmaster.cas.matlab2smt; /** * * @author matthew */ public final class MatlabLiteral implements MatlabExpression { public MatlabLiteral(String value) { m_value = value; } @Override public VariableType type() { return m_type; } @Override public String getCVC3Output() { return m_value; } final String m_value; final VariableType m_type = new RealVariableType(); }
src/test/java/ca/mcmaster/cas/matlab2smt/MatlabLiteralTest.java 0 → 100644 +44 −0 Original line number Diff line number Diff line /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package ca.mcmaster.cas.matlab2smt; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.*; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; /** * * @author matthew */ @RunWith(JUnit4.class) public class MatlabLiteralTest { /** * Test of type method, of class MatlabLiteral. */ @Test public void testType() { MatlabLiteral instance = new MatlabLiteral(null); VariableType expResult = new RealVariableType(); VariableType result = instance.type(); assertEquals(expResult, result); assertEquals(result, instance.type()); } /** * Test of getCVC3Output method, of class MatlabLiteral. */ @Test public void testGetCVC3Output() { MatlabLiteral instance = new MatlabLiteral("5"); String expResult = "5"; String result = instance.getCVC3Output(); assertEquals(expResult, result); } }