@@ -20,7 +20,7 @@ import { TerminalConfigHelper } from 'vs/workbench/contrib/terminal/browser/term
2020import { writeP } from 'vs/workbench/contrib/terminal/browser/terminalTestHelpers' ;
2121import { XtermTerminal } from 'vs/workbench/contrib/terminal/browser/xterm/xtermTerminal' ;
2222import { ITerminalConfiguration } from 'vs/workbench/contrib/terminal/common/terminal' ;
23- import { BufferContentTracker , replaceWithNonBreakingSpaces } from 'vs/workbench/contrib/terminalContrib/accessibility/browser/bufferContentTracker' ;
23+ import { BufferContentTracker } from 'vs/workbench/contrib/terminalContrib/accessibility/browser/bufferContentTracker' ;
2424import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle' ;
2525import { TestLifecycleService } from 'vs/workbench/test/browser/workbenchTestServices' ;
2626import { Terminal } from 'xterm' ;
@@ -72,22 +72,18 @@ suite('Buffer Content Tracker', () => {
7272 assert . strictEqual ( bufferTracker . lines . length , 0 ) ;
7373 await writeP ( xterm . raw , prompt ) ;
7474 xterm . clearBuffer ( ) ;
75- await bufferTracker . update ( ) ;
75+ bufferTracker . update ( ) ;
7676 assert . deepStrictEqual ( bufferTracker . lines , [ prompt ] ) ;
77- assert . strictEqual ( bufferTracker . lines . length , 1 ) ;
7877 } ) ;
7978 test ( 'repeated updates should not change the content' , async ( ) => {
8079 assert . strictEqual ( bufferTracker . lines . length , 0 ) ;
8180 await writeP ( xterm . raw , prompt ) ;
82- await bufferTracker . update ( ) ;
81+ bufferTracker . update ( ) ;
8382 assert . deepStrictEqual ( bufferTracker . lines , [ prompt ] ) ;
84- assert . strictEqual ( bufferTracker . lines . length , 1 ) ;
85- await bufferTracker . update ( ) ;
83+ bufferTracker . update ( ) ;
8684 assert . deepStrictEqual ( bufferTracker . lines , [ prompt ] ) ;
87- assert . strictEqual ( bufferTracker . lines . length , 1 ) ;
88- await bufferTracker . update ( ) ;
85+ bufferTracker . update ( ) ;
8986 assert . deepStrictEqual ( bufferTracker . lines , [ prompt ] ) ;
90- assert . strictEqual ( bufferTracker . lines . length , 1 ) ;
9187 } ) ;
9288 test ( 'should add lines in the viewport and scrollback' , async ( ) => {
9389 await writeAndAssertBufferState ( promptPlusData , 38 , xterm . raw , bufferTracker ) ;
@@ -98,31 +94,31 @@ suite('Buffer Content Tracker', () => {
9894 test ( 'should refresh viewport' , async ( ) => {
9995 await writeAndAssertBufferState ( promptPlusData , 6 , xterm . raw , bufferTracker ) ;
10096 await writeP ( xterm . raw , '\x1b[3Ainserteddata' ) ;
101- await bufferTracker . update ( ) ;
102- assert . deepStrictEqual ( bufferTracker . lines , [ promptPlusData , promptPlusData , `${ promptPlusData } inserteddata` , promptPlusData , promptPlusData , promptPlusData ] . map ( s => replaceWithNonBreakingSpaces ( s ) ) ) ;
97+ bufferTracker . update ( ) ;
98+ assert . deepStrictEqual ( bufferTracker . lines , [ promptPlusData , promptPlusData , `${ promptPlusData } inserteddata` , promptPlusData , promptPlusData , promptPlusData ] ) ;
10399 } ) ;
104100 test ( 'should refresh viewport with full scrollback' , async ( ) => {
105- const content = replaceWithNonBreakingSpaces ( `${ prompt } \r\n` . repeat ( 1030 ) . trimEnd ( ) ) ;
101+ const content = `${ prompt } \r\n` . repeat ( 1030 ) . trimEnd ( ) ;
106102 await writeP ( xterm . raw , content ) ;
107- await bufferTracker . update ( ) ;
103+ bufferTracker . update ( ) ;
108104 await writeP ( xterm . raw , '\x1b[4Ainsertion' ) ;
109- await bufferTracker . update ( ) ;
105+ bufferTracker . update ( ) ;
110106 const expected = content . split ( '\r\n' ) ;
111107 expected [ 1025 ] = `${ prompt } insertion` ;
112108 assert . deepStrictEqual ( bufferTracker . lines [ 1025 ] , `${ prompt } insertion` ) ;
113109 } ) ;
114110 test ( 'should cap the size of the cached lines, removing old lines in favor of new lines' , async ( ) => {
115111 const content = `${ prompt } \r\n` . repeat ( 1036 ) . trimEnd ( ) ;
116112 await writeP ( xterm . raw , content ) ;
117- await bufferTracker . update ( ) ;
118- const expected = content . split ( '\r\n' ) . map ( s => replaceWithNonBreakingSpaces ( s ) ) ;
113+ bufferTracker . update ( ) ;
114+ const expected = content . split ( '\r\n' ) ;
119115 // delete the 6 lines that should be trimmed
120116 for ( let i = 0 ; i < 6 ; i ++ ) {
121117 expected . pop ( ) ;
122118 }
123119 // insert a new character
124120 await writeP ( xterm . raw , '\x1b[2Ainsertion' ) ;
125- await bufferTracker . update ( ) ;
121+ bufferTracker . update ( ) ;
126122 expected [ 1027 ] = `${ prompt } insertion` ;
127123 assert . strictEqual ( bufferTracker . lines . length , expected . length ) ;
128124 assert . deepStrictEqual ( bufferTracker . lines , expected ) ;
@@ -132,8 +128,8 @@ suite('Buffer Content Tracker', () => {
132128async function writeAndAssertBufferState ( data : string , rows : number , terminal : Terminal , bufferTracker : BufferContentTracker ) : Promise < void > {
133129 const content = `${ data } \r\n` . repeat ( rows ) . trimEnd ( ) ;
134130 await writeP ( terminal , content ) ;
135- await bufferTracker . update ( ) ;
131+ bufferTracker . update ( ) ;
136132 assert . strictEqual ( bufferTracker . lines . length , rows ) ;
137- assert . deepStrictEqual ( bufferTracker . lines , content . split ( '\r\n' ) . map ( s => replaceWithNonBreakingSpaces ( s ) ) ) ;
133+ assert . deepStrictEqual ( bufferTracker . lines , content . split ( '\r\n' ) ) ;
138134}
139135
0 commit comments