Tests/ANSI: add test for #1161 E_NOTICE in ANSI

This commit is contained in:
terrafrost 2017-08-08 20:47:19 -05:00
parent 7ccb0d0b02
commit 89188ec570

View File

@ -28,4 +28,22 @@ class Unit_File_ANSITest extends PhpseclibTestCase
$this->assertSame($ansi->getScreen(), $expected);
}
public function testLineOverflow()
{
$str = '';
foreach (range('a', 'y') as $char) {
$str.= "$char\r\n";
}
$str.= str_repeat('z', 100);
$ansi = new File_ANSI();
$ansi->appendString($str);
$screen = $ansi->getScreen();
$lines = explode("\r\n", $screen);
$this->assertSame(24, count($lines));
$this->assertSame(str_repeat('z', 80), $lines[22]);
}
}