summaryrefslogtreecommitdiffstats
path: root/tests/Components/OptionsArrayTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Components/OptionsArrayTest.php')
-rw-r--r--tests/Components/OptionsArrayTest.php22
1 files changed, 18 insertions, 4 deletions
diff --git a/tests/Components/OptionsArrayTest.php b/tests/Components/OptionsArrayTest.php
index 42f54dd..8c24e3b 100644
--- a/tests/Components/OptionsArrayTest.php
+++ b/tests/Components/OptionsArrayTest.php
@@ -14,7 +14,7 @@ class OptionsArrayTest extends TestCase
{
$component = OptionsArray::parse(
new Parser(),
- $this->getTokensList('A B = (test) C'),
+ $this->getTokensList('A B = /*comment*/ (test) C'),
array(
'A' => 1,
'B' => array(2, 'var'),
@@ -26,9 +26,9 @@ class OptionsArrayTest extends TestCase
1 => 'A',
2 => array(
'name' => 'B',
- 'value' => 'test',
- 'value_' => 'test',
- 'equal' => false,
+ 'value' => '(test)',
+ 'value_' => '(test)',
+ 'equal' => true,
),
3 => 'C',
),
@@ -36,6 +36,20 @@ class OptionsArrayTest extends TestCase
);
}
+ public function testParseExpr()
+ {
+ $component = OptionsArray::parse(
+ new Parser(),
+ $this->getTokensList('SUM = (3 + 5) RESULT = 8'),
+ array(
+ 'SUM' => array(1, 'expr', array('bracketsDelimited' => true)),
+ 'RESULT' => array(2, 'var'),
+ )
+ );
+ $this->assertEquals('(3 + 5)', (string) $component->has('SUM'));
+ $this->assertEquals('8', $component->has('RESULT'));
+ }
+
public function testHas()
{
$component = new OptionsArray(