From d50b6659270e6ad9e654d44e1eed8cebd8d04f0d Mon Sep 17 00:00:00 2001 From: Bruce Wells Date: Mon, 26 Nov 2018 10:06:26 -0500 Subject: Fixed Lexor to correctly generate reverse polish notation (#33) * Updated from NeonXP/MathExecutor * Fixed function in () block issue --- tests/MathTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/MathTest.php') diff --git a/tests/MathTest.php b/tests/MathTest.php index c5dd60d..9acdb63 100644 --- a/tests/MathTest.php +++ b/tests/MathTest.php @@ -69,7 +69,21 @@ class MathTest extends \PHPUnit_Framework_TestCase ['(2 + 2)*-2'], ['(2+-2)*2'], + ['1 + 2 * 3 / (min(1, 5) + 2 + 1)'], + ['1 + 2 * 3 / (min(1, 5) - 2 + 5)'], + ['1 + 2 * 3 / (min(1, 5) * 2 + 1)'], + ['1 + 2 * 3 / (min(1, 5) / 2 + 1)'], + ['1 + 2 * 3 / (min(1, 5) / 2 * 1)'], + ['1 + 2 * 3 / (min(1, 5) / 2 / 1)'], + ['1 + 2 * 3 / (3 + min(1, 5) + 2 + 1)'], + ['1 + 2 * 3 / (3 - min(1, 5) - 2 + 1)'], + ['1 + 2 * 3 / (3 * min(1, 5) * 2 + 1)'], + ['1 + 2 * 3 / (3 / min(1, 5) / 2 + 1)'], + + ['sin(10) * cos(50) / min(10, 20/2)'], + ['sin(10) * cos(50) / min(10, (20/2))'], + ['sin(10) * cos(50) / min(10, (max(10,20)/2))'], ['100500 * 3.5E5'], ['100500 * 3.5E-5'], -- cgit v1.2.3