parser test editor: Fix emitting of !! hooks
authorKunal Mehta <legoktm@member.fsf.org>
Sun, 29 Jan 2017 09:56:43 +0000 (01:56 -0800)
committerTim Starling <tstarling@wikimedia.org>
Tue, 31 Jan 2017 03:12:15 +0000 (03:12 +0000)
The first newline was missing so a block like:
 !! hooks
 source
 !! endhooks

would turn into:
 !! hookssource
 !! endhooks

Change-Id: I2a4c5e52050d55fb0c9b4f5d0494eb00e34b233c

tests/parser/TestFileEditor.php

index 05b1216..7f64671 100644 (file)
@@ -125,7 +125,7 @@ class TestFileEditor {
                $line = $this->lines[$this->pos++];
                $heading = $this->getHeading( $line );
                $expectedEnd = 'end' . $heading;
-               $contents = $line;
+               $contents = "$line\n";
 
                do {
                        $line = $this->lines[$this->pos++];