Skip to content

Commit

Permalink
add test for arb.exceptions.ExpressionCompilerException: expected
Browse files Browse the repository at this point in the history
closing parenthesis, instead got ∏ at position 27 in expression
'n➔when(n=0,1,else,x*F(n-1)*(∏α₍ₖ₎{k=1…p}/∏β₍ₖ₎{k=1…q}))'
	at arb4j/arb.expressions.Expression.parse(Expression.java:695)
	at arb4j/arb.expressions.Expression.parseFinally(Expression.java:773)
	at arb4j/arb.expressions.Expression.parseMultiplicationAndDivisionOperations(Expression.java:884)
	at arb4j/arb.expressions.Expression.parseSecond(Expression.java:873)
	at arb4j/arb.expressions.Expression.parseFirst(Expression.java:734)
	at arb4j/arb.expressions.nodes.unary.When.parseWhenCondition(When.java:186)
	at arb4j/arb.expressions.nodes.unary.When.parse(When.java:146)
	at arb4j/arb.expressions.Expression.resolveFunctionInvocationOrVariableReference(Expression.java:948)
	at arb4j/arb.expressions.Expression.parse(Expression.java:707)
	at arb4j/arb.expressions.Expression.parseFinally(Expression.java:773)
	at arb4j/arb.expressions.Expression.parseSecond(Expression.java:871)
	at arb4j/arb.expressions.Expression.parseFirst(Expression.java:734)
	at arb4j/arb.expressions.Expression.parseRootNode(Expression.java:863)
	at arb4j/arb.expressions.Expression.generateEvaluationMethod(Expression.java:457)
	at arb4j/arb.expressions.Expression.generate(Expression.java:362)
	at arb4j/arb.expressions.Compiler.compile(Compiler.java:146)
	at arb4j/arb.expressions.Compiler.compile(Compiler.java:115)
	at arb4j/arb.expressions.Expression.instantiate(Expression.java:118)
	at arb4j/arb.functions.Function.express(Function.java:145)
	at arb4j/arb.functions.real.HypergeometricFunctionSequence.<init>(HypergeometricFunctionSequence.java:47)
	at arb4j/arb.functions.real.HypergeometricFunctionSequenceTest.test3F1(HypergeometricFunctionSequenceTest.java:14)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at [email protected]/junit.framework.TestCase.runTest(TestCase.java:177)
	at [email protected]/junit.framework.TestCase.runBare(TestCase.java:142)
	at [email protected]/junit.framework.TestResult$1.protect(TestResult.java:122)
	at [email protected]/junit.framework.TestResult.runProtected(TestResult.java:142)
	at [email protected]/junit.framework.TestResult.run(TestResult.java:125)
	at [email protected]/junit.framework.TestCase.run(TestCase.java:130)
	at [email protected]/junit.framework.TestSuite.runTest(TestSuite.java:241)
	at [email protected]/junit.framework.TestSuite.run(TestSuite.java:236)
	at [email protected]/org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:90)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)
  • Loading branch information
crowlogic committed Jan 27, 2024
1 parent e506f4e commit 9fff678
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package arb.functions.real;

import static java.lang.System.out;

import arb.Integer;
import arb.RealPolynomial;
import junit.framework.TestCase;

public class HypergeometricFunctionSequenceTest extends
TestCase
{
public static void test3F1()
{
try ( HypergeometricFunctionSequence F = new HypergeometricFunctionSequence(3,
1))
{
F.α.set(1, 4, -4);
F.β.set(0.5);

try ( var index = new Integer())
{
for (int n = 0; n < 5; n++)
{
RealPolynomial fn = F.F.evaluate(index.set(n), 0, 128, new RealPolynomial());
out.format("F(%d,x)=%s\n", n, fn);
}
}
}
}
}

0 comments on commit 9fff678

Please sign in to comment.