| @@ 19-27 (lines=9) @@ | ||
| 16 | $this->assertEquals("a", $obj->next()); |
|
| 17 | } |
|
| 18 | ||
| 19 | public function testMultipleLines() { |
|
| 20 | $obj = new InputStream("a\nb\n"); |
|
| 21 | ||
| 22 | $this->assertEquals("a", $obj->next()); |
|
| 23 | $this->assertEquals("\n", $obj->next()); |
|
| 24 | $this->assertEquals("b", $obj->next()); |
|
| 25 | $this->assertEquals("\n", $obj->next()); |
|
| 26 | $this->assertTrue($obj->eof()); |
|
| 27 | } |
|
| 28 | ||
| 29 | /** |
|
| 30 | * @expectedException \Vlaswinkel\Lua\ParseException |
|
| @@ 69-79 (lines=11) @@ | ||
| 66 | * @expectedException \Vlaswinkel\Lua\ParseException |
|
| 67 | * @expectedExceptionMessage Complex error (2:2) |
|
| 68 | */ |
|
| 69 | public function testMultipleLineAndColumnError() { |
|
| 70 | $obj = new InputStream("ab\nab\n"); |
|
| 71 | $this->assertEquals("a", $obj->next()); |
|
| 72 | $this->assertEquals("b", $obj->next()); |
|
| 73 | $this->assertEquals("\n", $obj->next()); |
|
| 74 | ||
| 75 | $this->assertEquals("a", $obj->next()); |
|
| 76 | $this->assertEquals("b", $obj->next()); |
|
| 77 | ||
| 78 | $obj->error("Complex error"); |
|
| 79 | } |
|
| 80 | } |
|