public class JepTest
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected Jep |
jep
The parser
|
protected java.lang.Object |
myFalse |
protected java.lang.Object |
myTrue |
static boolean |
PRINT_RESULTS |
| Constructor and Description |
|---|
JepTest() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertEqNodes(java.lang.String s,
Node expected,
Node actual) |
protected java.lang.Object |
buildMatrix(java.lang.Object[]... eles) |
protected java.lang.Object |
buildVector(java.lang.Object... eles) |
protected java.lang.Object |
calcValue(Node node)
Calculate the value of an expression.
|
protected java.lang.Object |
calcValue(java.lang.String expr)
Calculate the value of an expression.
|
void |
checkVector(java.lang.Object[] expected,
java.lang.Object actual) |
protected boolean |
compareRecursive(Node node1,
Node node2) |
protected void |
complexValueTest(java.lang.String expr,
Complex expected,
double tol)
Test parse-evaluate with complex number and given tolerance.
|
protected void |
myAssertEquals(java.lang.String msg,
java.lang.Object expected,
java.lang.Object actual) |
protected void |
myAssertNaN(java.lang.String msg,
java.lang.Object actual) |
protected void |
myAssertNull(java.lang.String msg,
java.lang.Object actual) |
protected java.lang.Object |
negativeZero() |
static void |
nodeTest(Node n,
java.lang.Object v) |
static void |
nodeTest(Node n,
Operator op) |
static void |
nodeTest(Node n,
java.lang.String name) |
static void |
nodeTest(Node n,
Variable v) |
protected void |
printTestHeader(java.lang.String str)
Prints a header with the name of the test as specified in str.
|
void |
setUp()
Sets up the parser.
|
void |
testAssign() |
void |
testBinom() |
void |
testBlankParser()
Test creating a Jep instance with no functions and no variables.
|
void |
testCaseNull() |
void |
testCaseString() |
void |
testChangeVariable()
Test changing variables value after parsing
|
void |
testChangeVariableComplex()
Test changing variables value after parsing
|
void |
testComments() |
void |
testComplex() |
void |
testEmptyEqn() |
void |
testEmptyEqn2() |
void |
testEvalExceptions()
Test whether evaluation exceptions are thrown when they should be.
|
void |
testEvaluate()
Tests the evaluate() method.
|
void |
testEvaluateComplex() |
void |
testEvaluateString() |
void |
testExpectedTokenSequence()
Tests for bug #52
|
void |
testFormat() |
void |
testFunction() |
void |
testIf() |
void |
testImplicitMul() |
void |
testLazyLogical() |
void |
testLazyLogical2() |
void |
testLazyLogicalBug()
Test for bug with 1&&1&&1
|
void |
testListAccess() |
void |
testListExtra() |
void |
testListFunctions() |
void |
testLogarithm() |
void |
testLogical() |
void |
testMacroFunction() |
void |
testMultiDimArray() |
void |
testMultiLine() |
void |
testMultiplyBug() |
void |
testNaN() |
void |
testNoAssign() |
void |
testNull() |
void |
testNumberAsBooleanLogical() |
void |
testNumbers() |
void |
testNumParam() |
void |
testParseException()
Tests whether a parse exceptions are thrown when they should be.
|
void |
testPlusPlus() |
void |
testRecursiveMacroFunction() |
void |
testSemiColon() |
void |
testSetAllowUndeclared()
Tests whether allowUndeclared is working properly.
|
void |
testSimpleSum() |
void |
testSpecialFunctions() |
void |
testSpecialFunctions(boolean hasRealEval,
boolean hasCallback) |
void |
testStrings() |
void |
testStringsFun() |
void |
testSwitch() |
void |
testUminusPower() |
void |
testX2Y() |
protected void |
valueTest(java.lang.String expr,
double a,
double tol)
Test values to within a given precision
|
protected void |
valueTest(java.lang.String expr,
java.lang.Object expected)
Test result j.evaluate(j.parse(expr))
|
protected void |
valueTestFail(java.lang.String expr)
Test whether evaluating an expression results in an exception
|
protected void |
valueTestNaN(java.lang.String expr)
Test whether an expression evaluates to NaN
|
protected void |
valueTestNull(java.lang.String expr) |
protected void |
valueTestString(java.lang.String expr,
java.lang.String expected) |
public static final boolean PRINT_RESULTS
protected Jep jep
protected java.lang.Object myTrue
protected java.lang.Object myFalse
public void setUp()
protected void printTestHeader(java.lang.String str)
protected void valueTest(java.lang.String expr,
java.lang.Object expected)
throws java.lang.Exception
expr - the expression to parse and evaluateexpected - result expectedjava.lang.Exceptionprotected java.lang.Object calcValue(Node node) throws java.lang.Exception
node - java.lang.Exceptionprotected java.lang.Object calcValue(java.lang.String expr)
throws java.lang.Exception
expr - java.lang.Exceptionprotected void myAssertEquals(java.lang.String msg,
java.lang.Object expected,
java.lang.Object actual)
throws EvaluationException
EvaluationExceptionprotected void myAssertNaN(java.lang.String msg,
java.lang.Object actual)
protected void myAssertNull(java.lang.String msg,
java.lang.Object actual)
protected void valueTestNull(java.lang.String expr)
throws java.lang.Exception
java.lang.Exceptionprotected void valueTestNaN(java.lang.String expr)
throws java.lang.Exception
expr - java.lang.Exceptionprotected void valueTestFail(java.lang.String expr)
throws java.lang.Exception
expr - java.lang.Exceptionprotected void valueTestString(java.lang.String expr,
java.lang.String expected)
throws java.lang.Exception
java.lang.Exceptionprotected void complexValueTest(java.lang.String expr,
Complex expected,
double tol)
throws java.lang.Exception
expr - expected - tol - java.lang.Exceptionprotected void valueTest(java.lang.String expr,
double a,
double tol)
throws java.lang.Exception
expr - expressiona - the expected valuetol - tolerancejava.lang.Exceptionpublic static void nodeTest(Node n, java.lang.String name)
public static void nodeTest(Node n, java.lang.Object v)
public void testSimpleSum()
throws java.lang.Exception
java.lang.Exceptionpublic void testEvaluate()
throws java.lang.Exception
java.lang.Exceptionpublic void testEvaluateComplex()
throws java.lang.Exception
java.lang.Exceptionpublic void testEvaluateString()
throws java.lang.Exception
java.lang.Exceptionpublic void testChangeVariable()
throws java.lang.Exception
java.lang.Exceptionpublic void testChangeVariableComplex()
throws java.lang.Exception
java.lang.Exceptionpublic void testSetAllowUndeclared()
throws java.lang.Exception
java.lang.Exceptionprotected java.lang.Object negativeZero()
public void testNumbers()
throws java.lang.Exception
java.lang.Exceptionpublic void testStrings()
throws java.lang.Exception
java.lang.Exceptionpublic void testStringsFun()
throws java.lang.Exception
java.lang.Exceptionpublic void testNumberAsBooleanLogical()
throws java.lang.Exception
java.lang.Exceptionpublic void testLogical()
throws java.lang.Exception
java.lang.Exceptionpublic void testNull()
throws java.lang.Exception
java.lang.Exceptionpublic void testNaN()
throws java.lang.Exception
java.lang.Exceptionpublic void testComplex()
throws java.lang.Exception
java.lang.Exceptionpublic void testFunction()
throws java.lang.Exception
java.lang.Exceptionpublic void testIf()
throws java.lang.Exception
java.lang.Exceptionpublic void testPlusPlus()
throws java.lang.Exception
java.lang.Exceptionpublic void testImplicitMul()
throws java.lang.Exception
java.lang.Exceptionpublic void testUminusPower()
throws java.lang.Exception
java.lang.Exceptionpublic void testNumParam()
throws java.lang.Exception
java.lang.Exceptionpublic void testBinom()
throws ParseException,
java.lang.Exception
ParseExceptionjava.lang.Exceptionpublic void testFormat()
throws java.lang.Exception
java.lang.Exceptionpublic void testAssign()
throws java.lang.Exception
java.lang.Exceptionpublic void testMultiplyBug()
throws java.lang.Exception
java.lang.Exceptionpublic void testNoAssign()
throws java.lang.Exception
java.lang.Exceptionpublic void testLazyLogical()
throws java.lang.Exception
java.lang.Exceptionpublic void testLazyLogical2()
throws java.lang.Exception
java.lang.Exceptionpublic void testLazyLogicalBug()
throws java.lang.Exception
java.lang.Exceptionpublic void testLogarithm()
throws java.lang.Exception
java.lang.Exceptionpublic void testBlankParser()
throws java.lang.Exception
java.lang.Exceptionpublic void testMacroFunction()
throws java.lang.Exception
java.lang.Exceptionpublic void testRecursiveMacroFunction()
throws java.lang.Exception
java.lang.Exceptionpublic void testParseException()
public void testEvalExceptions()
public void testSemiColon()
throws java.lang.Exception
java.lang.Exceptionpublic void testMultiLine()
throws java.lang.Exception
java.lang.Exceptionpublic void testEmptyEqn()
throws java.lang.Exception
java.lang.Exceptionpublic void testComments()
throws java.lang.Exception
java.lang.Exceptionpublic void testEmptyEqn2()
throws java.lang.Exception
java.lang.Exceptionpublic void testX2Y()
throws java.lang.Exception
java.lang.Exceptionpublic void testExpectedTokenSequence()
public void testSwitch()
throws java.lang.Exception
java.lang.Exceptionpublic void testCaseString()
throws java.lang.Exception
java.lang.Exceptionpublic void testCaseNull()
throws java.lang.Exception
java.lang.Exceptionprotected java.lang.Object buildVector(java.lang.Object... eles)
throws java.lang.Exception
java.lang.Exceptionprotected java.lang.Object buildMatrix(java.lang.Object[]... eles)
throws java.lang.Exception
java.lang.Exceptionpublic void testListAccess()
throws java.lang.Exception
java.lang.Exceptionpublic void checkVector(java.lang.Object[] expected,
java.lang.Object actual)
throws EvaluationException
EvaluationExceptionpublic void testMultiDimArray()
throws java.lang.Exception
java.lang.Exceptionpublic void testListFunctions()
throws java.lang.Exception
java.lang.Exceptionpublic void testListExtra()
throws java.lang.Exception
java.lang.Exceptionpublic void testSpecialFunctions()
throws java.lang.Exception
java.lang.Exceptionpublic void testSpecialFunctions(boolean hasRealEval,
boolean hasCallback)
throws java.lang.Exception
java.lang.ExceptionCopyright © 2018 Singular Systems http://www.singularsys.com/jep