diff options
Diffstat (limited to 'tests/MathTest.php')
-rw-r--r-- | tests/MathTest.php | 7 |
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)')); + } } |