Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

improving tests for latex commands

  • Loading branch information...
commit ee7837c22574d646dda82553d546c65d7bf2c682 1 parent 01986e3
@gutomaia authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 tests/LatexAnalyzerTest.php
View
16 tests/LatexAnalyzerTest.php
@@ -222,6 +222,22 @@ public function testIsParsingMultipleCommandsAndNewlines() {
$this->assertEquals(1, $token->column);
}
+ public function testParsingBeginDocumentCommand(){
+ $tokens = $this->latex->parse('\begin{document}');
+ $this->assertNotNull($tokens);
+ $this->assertEquals(1, sizeof($tokens));
+ $this->assertEquals('T_LATEX_COMMAND', $tokens[0]->type);
+ $this->assertEquals('\begin{document}', $tokens[0]->value);
+ }
+
+ public function testParsingFrontmatterCommand(){
+ $tokens = $this->latex->parse('\frontmatter');
+ $this->assertNotNull($tokens);
+ $this->assertEquals(1, sizeof($tokens));
+ $this->assertEquals('T_LATEX_COMMAND', $tokens[0]->type);
+ $this->assertEquals('\frontmatter', $tokens[0]->value);
+ }
+
public function testIsParsingCommandsWithoutParameters() {
$tokens = $this->latex->parse('Lorem \frontmatter');
$this->assertNotNull($tokens);
Please sign in to comment.
Something went wrong with that request. Please try again.