From 9fff67821ea9583a5999a056f05037747fae0856 Mon Sep 17 00:00:00 2001 From: "Stephen A. Crowley" Date: Sat, 27 Jan 2024 05:53:41 -0600 Subject: [PATCH] =?UTF-8?q?add=20test=20for=20arb.exceptions.ExpressionCom?= =?UTF-8?q?pilerException:=20expected=20closing=20parenthesis,=20instead?= =?UTF-8?q?=20got=20=E2=88=8F=20at=20position=2027=20in=20expression=20'n?= =?UTF-8?q?=E2=9E=94when(n=3D0,1,else,x*F(n-1)*(=E2=88=8F=CE=B1=E2=82=8D?= =?UTF-8?q?=E2=82=96=E2=82=8E{k=3D1=E2=80=A6p}/=E2=88=8F=CE=B2=E2=82=8D?= =?UTF-8?q?=E2=82=96=E2=82=8E{k=3D1=E2=80=A6q}))'=20=09at=20arb4j/arb.expr?= =?UTF-8?q?essions.Expression.parse(Expression.java:695)=20=09at=20arb4j/a?= =?UTF-8?q?rb.expressions.Expression.parseFinally(Expression.java:773)=20?= =?UTF-8?q?=09at=20arb4j/arb.expressions.Expression.parseMultiplicationAnd?= =?UTF-8?q?DivisionOperations(Expression.java:884)=20=09at=20arb4j/arb.exp?= =?UTF-8?q?ressions.Expression.parseSecond(Expression.java:873)=20=09at=20?= =?UTF-8?q?arb4j/arb.expressions.Expression.parseFirst(Expression.java:734?= =?UTF-8?q?)=20=09at=20arb4j/arb.expressions.nodes.unary.When.parseWhenCon?= =?UTF-8?q?dition(When.java:186)=20=09at=20arb4j/arb.expressions.nodes.una?= =?UTF-8?q?ry.When.parse(When.java:146)=20=09at=20arb4j/arb.expressions.Ex?= =?UTF-8?q?pression.resolveFunctionInvocationOrVariableReference(Expressio?= =?UTF-8?q?n.java:948)=20=09at=20arb4j/arb.expressions.Expression.parse(Ex?= =?UTF-8?q?pression.java:707)=20=09at=20arb4j/arb.expressions.Expression.p?= =?UTF-8?q?arseFinally(Expression.java:773)=20=09at=20arb4j/arb.expression?= =?UTF-8?q?s.Expression.parseSecond(Expression.java:871)=20=09at=20arb4j/a?= =?UTF-8?q?rb.expressions.Expression.parseFirst(Expression.java:734)=20=09?= =?UTF-8?q?at=20arb4j/arb.expressions.Expression.parseRootNode(Expression.?= =?UTF-8?q?java:863)=20=09at=20arb4j/arb.expressions.Expression.generateEv?= =?UTF-8?q?aluationMethod(Expression.java:457)=20=09at=20arb4j/arb.express?= =?UTF-8?q?ions.Expression.generate(Expression.java:362)=20=09at=20arb4j/a?= =?UTF-8?q?rb.expressions.Compiler.compile(Compiler.java:146)=20=09at=20ar?= =?UTF-8?q?b4j/arb.expressions.Compiler.compile(Compiler.java:115)=20=09at?= =?UTF-8?q?=20arb4j/arb.expressions.Expression.instantiate(Expression.java?= =?UTF-8?q?:118)=20=09at=20arb4j/arb.functions.Function.express(Function.j?= =?UTF-8?q?ava:145)=20=09at=20arb4j/arb.functions.real.HypergeometricFunct?= =?UTF-8?q?ionSequence.(HypergeometricFunctionSequence.java:47)=20?= =?UTF-8?q?=09at=20arb4j/arb.functions.real.HypergeometricFunctionSequence?= =?UTF-8?q?Test.test3F1(HypergeometricFunctionSequenceTest.java:14)=20=09a?= =?UTF-8?q?t=20java.base/jdk.internal.reflect.DirectMethodHandleAccessor.i?= =?UTF-8?q?nvoke(DirectMethodHandleAccessor.java:103)=20=09at=20java.base/?= =?UTF-8?q?java.lang.reflect.Method.invoke(Method.java:580)=20=09at=20juni?= =?UTF-8?q?t@4.13.2/junit.framework.TestCase.runTest(TestCase.java:177)=20?= =?UTF-8?q?=09at=20junit@4.13.2/junit.framework.TestCase.runBare(TestCase.?= =?UTF-8?q?java:142)=20=09at=20junit@4.13.2/junit.framework.TestResult$1.p?= =?UTF-8?q?rotect(TestResult.java:122)=20=09at=20junit@4.13.2/junit.framew?= =?UTF-8?q?ork.TestResult.runProtected(TestResult.java:142)=20=09at=20juni?= =?UTF-8?q?t@4.13.2/junit.framework.TestResult.run(TestResult.java:125)=20?= =?UTF-8?q?=09at=20junit@4.13.2/junit.framework.TestCase.run(TestCase.java?= =?UTF-8?q?:130)=20=09at=20junit@4.13.2/junit.framework.TestSuite.runTest(?= =?UTF-8?q?TestSuite.java:241)=20=09at=20junit@4.13.2/junit.framework.Test?= =?UTF-8?q?Suite.run(TestSuite.java:236)=20=09at=20junit@4.13.2/org.junit.?= =?UTF-8?q?internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java?= =?UTF-8?q?:90)=20=09at=20org.eclipse.jdt.internal.junit4.runner.JUnit4Tes?= =?UTF-8?q?tReference.run(JUnit4TestReference.java:93)=20=09at=20org.eclip?= =?UTF-8?q?se.jdt.internal.junit.runner.TestExecution.run(TestExecution.ja?= =?UTF-8?q?va:40)=20=09at=20org.eclipse.jdt.internal.junit.runner.RemoteTe?= =?UTF-8?q?stRunner.runTests(RemoteTestRunner.java:529)=20=09at=20org.ecli?= =?UTF-8?q?pse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteT?= =?UTF-8?q?estRunner.java:756)=20=09at=20org.eclipse.jdt.internal.junit.ru?= =?UTF-8?q?nner.RemoteTestRunner.run(RemoteTestRunner.java:452)=20=09at=20?= =?UTF-8?q?org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(Rem?= =?UTF-8?q?oteTestRunner.java:210)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HypergeometricFunctionSequenceTest.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/test/java/arb/functions/real/HypergeometricFunctionSequenceTest.java diff --git a/src/test/java/arb/functions/real/HypergeometricFunctionSequenceTest.java b/src/test/java/arb/functions/real/HypergeometricFunctionSequenceTest.java new file mode 100644 index 000000000..086762682 --- /dev/null +++ b/src/test/java/arb/functions/real/HypergeometricFunctionSequenceTest.java @@ -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); + } + } + } + } +}