Added test for correctness of treatment of brackets inside string arguments ( {{foo '(bar)'}} )

This commit is contained in:
majortom731 2014-03-17 23:00:36 +01:00
parent 30f7afeb84
commit 5a58d27ad3

View File

@ -795,6 +795,11 @@ class HandlebarsTest extends \PHPUnit_Framework_TestCase
// assert that subexpression result is inserted correctly as argument to top level helper
$this->assertEquals('42', $engine->render('{{add 21 (add 10 (add 5 6))}}', array()));
// assert that bracketed expressions within string literals are treated correctly
$this->assertEquals("'(test)'Test.", $engine->render("{{test '(test)'}}", array()));
$this->assertEquals("')'Test.Test.", $engine->render("{{test (test ')')}}", array()));
}
}