示例#1
0
 /**
  * @dataProvider getUnoptimizedData
  */
 public function testCompileWithoutOptimization($expression, $expectedDescription)
 {
     $lexer = new Lexer();
     $parser = new Parser(array());
     $compiler = new Compiler();
     $node = $parser->parse($lexer->tokenize($expression));
     $aDie = $compiler->compile($node);
     $this->assertEquals($expectedDescription, $aDie->getValueDescription());
 }
示例#2
0
文件: LexerTest.php 项目: fervo/rollo
 /**
  * @dataProvider getTokenizeData
  */
 public function testTokenize($tokens, $expression)
 {
     $tokens[] = new Token('end of expression', null, strlen($expression) + 1);
     $lexer = new Lexer();
     $this->assertEquals(new TokenStream($tokens), $lexer->tokenize($expression));
 }
示例#3
0
 /**
  * @dataProvider getParseData
  */
 public function testParse($node, $expression, $names = array())
 {
     $lexer = new Lexer();
     $parser = new Parser(array());
     $this->assertEquals($node, $parser->parse($lexer->tokenize($expression), $names));
 }