Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit a706f7c

Browse files
committed
Test invalid chars in expression
Signed-off-by: Michal Čihař <michal@cihar.com>
1 parent f3a5ddf commit a706f7c

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/Expression.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public static function factory($value) {
8484
return new Expressions\OperatorAnd($value);
8585
}
8686

87-
throw new \Exception('Undefined Value ' . $value);
87+
throw new \RuntimeException('Undefined Value ' . $value);
8888
}
8989

9090
abstract public function operate(Stack $stack, $variables=array());

tests/CalculateTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ public function errorEquations()
183183
array('1 + (1 : 2)'),
184184
array('(1 + 2'),
185185
array('1 + 2)'),
186+
array('#'),
186187
);
187188
}
188189
}

0 commit comments

Comments
 (0)