mirror of
https://github.com/danog/tgseclib.git
synced 2024-12-12 17:17:34 +01:00
Merge branch '2.0'
This commit is contained in:
commit
04fce0b39b
@ -419,7 +419,7 @@ class ANSI
|
|||||||
|
|
||||||
if ($this->x > $this->max_x) {
|
if ($this->x > $this->max_x) {
|
||||||
$this->x = 0;
|
$this->x = 0;
|
||||||
$this->y++;
|
$this->newLine();
|
||||||
} else {
|
} else {
|
||||||
$this->x++;
|
$this->x++;
|
||||||
}
|
}
|
||||||
|
@ -44,4 +44,22 @@ class Unit_File_ANSITest extends PhpseclibTestCase
|
|||||||
|
|
||||||
$this->assertSame($ansi->getScreen(), $expected);
|
$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 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]);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user