aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlexander Kiryukhin <alexander@kiryukhin.su>2018-09-06 20:41:13 +0300
committerGitHub <noreply@github.com>2018-09-06 20:41:13 +0300
commit7b657db13f0b76432ca0039e45f4b8f5e09879c2 (patch)
tree954c50f2644212742442e0027efb081620d2a109 /tests
parenta969571772a9761f67672b229741f209f5391560 (diff)
parentaa1a092a9e231e8f923ab40365dff092c2908903 (diff)
Merge branch 'master' into dev
Diffstat (limited to 'tests')
-rw-r--r--tests/MathTest.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/MathTest.php b/tests/MathTest.php
index 2b2727f..9bf8d97 100644
--- a/tests/MathTest.php
+++ b/tests/MathTest.php
@@ -27,6 +27,18 @@ class MathTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($calculator->execute($expression), $phpResult);
}
+ public function testZeroDevision()
+ {
+ $calculator = new MathExecutor();
+ $this->assertEquals($calculator->execute('1 / 0'), 0);
+ }
+
+ public function testExponentiation()
+ {
+ $calculator = new MathExecutor();
+ $this->assertEquals($calculator->execute('10 ^ 2'), 100);
+ }
+
/**
* Expressions data provider
*/