aboutsummaryrefslogtreecommitdiff
path: root/tests/MathTest.php
diff options
context:
space:
mode:
authorClément Lafont <johnrazeur@gmail.com>2020-01-13 20:09:18 +0300
committerBruce Wells <brucekwells@gmail.com>2020-01-13 20:09:18 +0300
commit707e22029d8bcfc93918eaca27905d14e376d3b5 (patch)
tree2a52c65e50cf995dbad15110e1f434b35a6df275 /tests/MathTest.php
parentff550b4180ac88bf1dd2425e137f459342fef0a7 (diff)
Left bracket and minus fix (#55)V1.1.2
* Left bracket and minus fix (#54) * Add test for left bracket and minus fix #55
Diffstat (limited to 'tests/MathTest.php')
-rw-r--r--tests/MathTest.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/MathTest.php b/tests/MathTest.php
index 27817db..3e5a7ff 100644
--- a/tests/MathTest.php
+++ b/tests/MathTest.php
@@ -297,4 +297,11 @@ class MathTest extends \PHPUnit\Framework\TestCase
$calculator->execute('test("' . $testString . '")'); // single quotes
$calculator->execute("test('" . $testString . "')"); // double quotes
}
+
+ public function testBeginWithBracketAndMinus()
+ {
+ $calculator = new MathExecutor();
+ $this->assertEquals(-4, $calculator->execute('(-4)'));
+ $this->assertEquals(1, $calculator->execute('(-4 + 5)'));
+ }
}