Skip to content

Commit d955e4f

Browse files
committed
Additional assertions for getToken
1 parent 0f5138f commit d955e4f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/CalculatorTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,14 @@ public function setUp() {
1717
}
1818

1919
public function testGetToken() {
20-
$this->_calculator->setExpression("1+2-3");
20+
$this->_calculator->setExpression('1+2-3');
2121
$this->assertEquals(['1', '+', '2', '-', '3'], $this->_calculator->getTokens());
22+
23+
$this->_calculator->setExpression('-5*(-5+1)');
24+
$this->assertEquals(['-5', '*', '(', '-5', '+', '1', ')'], $this->_calculator->getTokens());
25+
26+
$this->_calculator->setExpression('sqrt(-5)');
27+
$this->assertEquals(['sqrt', '(', '-5', ')'], $this->_calculator->getTokens());
2228
}
2329
}
2430

0 commit comments

Comments
 (0)