diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | composer.json | 5 | ||||
-rw-r--r-- | tests/MathTest.php | 10 |
3 files changed, 12 insertions, 5 deletions
@@ -18,7 +18,7 @@ ## Install via Composer: ``` -composer require "nxp/math-executor" +composer require nxp/math-executor ``` ## Sample usage: diff --git a/composer.json b/composer.json index 4c57b47..8a5bd99 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "nxp/math-executor", "description": "Simple math expressions calculator", "minimum-stability": "stable", - "keywords": ["math","parser","expression","calculator"], + "keywords": ["math","parser","expression","calculator","formula","mathmatics"], "homepage": "http://github.com/NeonXP/MathExecutor", "license": "MIT", "authors": [ @@ -19,8 +19,5 @@ }, "autoload": { "psr-0": {"NXP": "src/"} - }, - "config": { - "bin-dir": "bin" } } diff --git a/tests/MathTest.php b/tests/MathTest.php index 0de2465..cc4cd1a 100644 --- a/tests/MathTest.php +++ b/tests/MathTest.php @@ -37,6 +37,10 @@ class MathTest extends \PHPUnit\Framework\TestCase /** * Expressions data provider + * + * Most tests can go in here. The idea is that each expression will be evaluated by MathExecutor and by PHP with eval. + * The results should be the same. If they are not, then the test fails. No need to add extra test unless you are doing + * something more complete and not a simple mathmatical expression. */ public function providerExpressions() { @@ -186,6 +190,12 @@ class MathTest extends \PHPUnit\Framework\TestCase ['1 + 5 < 3 + 1'], ['1 + 3 <= 5 + 1'], ['1 + 5 <= 5 + 1'], + + ['(-4)'], + ['(-4 + 5)'], + + ['1 - 0'], + ['1-0'], ]; } |