From 0b34a8e543fbae82880ea141af0c45dae8abed15 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sun, 30 Jul 2017 11:24:58 -0500 Subject: [PATCH] Tests/ASN1: add additional unit test inspired by #1151 --- tests/Unit/File/ANSITest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/Unit/File/ANSITest.php b/tests/Unit/File/ANSITest.php index 373504d1..3f6e607e 100644 --- a/tests/Unit/File/ANSITest.php +++ b/tests/Unit/File/ANSITest.php @@ -28,4 +28,20 @@ class Unit_File_ANSITest extends PhpseclibTestCase $this->assertSame($ansi->getScreen(), $expected); } + + public function testCaseJ() + { + $str = "\x1B[H"; // Move cursor to upper left corner + $str.= "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + $str.= "\x1B[H"; // Move cursor to upper left corner + $str.= "\x1B[J"; // Clear screen from cursor down + + $ansi = new ANSI(); + $ansi->appendString($str); + + $expected = '
';
+        $expected.= '
'; + + $this->assertSame($ansi->getScreen(), $expected); + } }