Add string concatenation (#3)

This commit is contained in:
bzick
2013-08-03 18:56:17 +04:00
parent 1e7cf29290
commit 09f952686b
4 changed files with 113 additions and 78 deletions

View File

@@ -676,10 +676,20 @@ class TemplateTest extends TestCase
);
}
public static function providerConcat() {
return array(
array('{"string" ~ $one ~ up("end")}', "string1END"),
array('{"string" ~ $one++ ~ "end"}', "string1end"),
array('{"string" ~ ++$one ~ "end"}', "string2end"),
array('{"string" ~ "one" ~ "end"}', "stringoneend"),
array('{"string" ~ 1 ~ "end"}', "string1end"),
);
}
public function _testSandbox()
{
try {
var_dump($this->fenom->compileCode('{$a!"no way":"right"}')->getBody());
var_dump($this->fenom->compileCode('{$a++~"hi"~time("Y:m:d")}')->getBody());
} catch (\Exception $e) {
print_r($e->getMessage() . "\n" . $e->getTraceAsString());
}
@@ -891,5 +901,13 @@ class TemplateTest extends TestCase
{
$this->exec($code, self::getVars(), $result);
}
/**
* @dataProvider providerConcat
*/
public function testConcat($code, $result)
{
$this->exec($code, self::getVars(), $result);
}
}