@@ -147,10 +147,10 @@ suite('Terminal - Shell Integration with PYTHONSTARTUP', () => {
147147 registerTerminalLinkProviderStub . restore ( ) ;
148148 } ) ;
149149
150- test ( 'Verify provideTerminalLinks returns links when context.line contains expectedNativeLink' , ( ) => {
150+ test ( 'Mac - Verify provideTerminalLinks returns links when context.line contains expectedNativeLink' , ( ) => {
151151 const provider = new CustomTerminalLinkProvider ( ) ;
152152 const context : TerminalLinkContext = {
153- line : 'Some random string with VS Code Native REPL in it ' ,
153+ line : 'Some random string with Cmd click to launch VS Code Native REPL' ,
154154 terminal : { } as Terminal ,
155155 } ;
156156 const token : CancellationToken = {
@@ -168,10 +168,39 @@ suite('Terminal - Shell Integration with PYTHONSTARTUP', () => {
168168 assert . equal ( links [ 0 ] . command , 'python.startNativeREPL' , 'Expected command to be python.startNativeREPL' ) ;
169169 assert . equal (
170170 links [ 0 ] . startIndex ,
171- context . line . indexOf ( 'VS Code Native REPL' ) ,
172- 'Expected startIndex to be 0 ' ,
171+ context . line . indexOf ( 'Cmd click to launch VS Code Native REPL' ) ,
172+ 'start index should match ' ,
173173 ) ;
174- assert . equal ( links [ 0 ] . length , 'VS Code Native REPL' . length , 'Expected length to be 16' ) ;
174+ assert . equal ( links [ 0 ] . length , 'Cmd click to launch VS Code Native REPL' . length , 'Match expected length' ) ;
175+ assert . equal ( links [ 0 ] . tooltip , Repl . launchNativeRepl , 'Expected tooltip to be Launch VS Code Native REPL' ) ;
176+ }
177+ } ) ;
178+
179+ test ( 'Windows/Linux - Verify provideTerminalLinks returns links when context.line contains expectedNativeLink' , ( ) => {
180+ const provider = new CustomTerminalLinkProvider ( ) ;
181+ const context : TerminalLinkContext = {
182+ line : 'Some random string with Ctrl click to launch VS Code Native REPL' ,
183+ terminal : { } as Terminal ,
184+ } ;
185+ const token : CancellationToken = {
186+ isCancellationRequested : false ,
187+ onCancellationRequested : new EventEmitter < unknown > ( ) . event ,
188+ } ;
189+
190+ const links = provider . provideTerminalLinks ( context , token ) ;
191+
192+ assert . isNotNull ( links , 'Expected links to be not undefined' ) ;
193+ assert . isArray ( links , 'Expected links to be an array' ) ;
194+ assert . isNotEmpty ( links , 'Expected links to be not empty' ) ;
195+
196+ if ( Array . isArray ( links ) ) {
197+ assert . equal ( links [ 0 ] . command , 'python.startNativeREPL' , 'Expected command to be python.startNativeREPL' ) ;
198+ assert . equal (
199+ links [ 0 ] . startIndex ,
200+ context . line . indexOf ( 'Ctrl click to launch VS Code Native REPL' ) ,
201+ 'start index should match' ,
202+ ) ;
203+ assert . equal ( links [ 0 ] . length , 'Ctrl click to launch VS Code Native REPL' . length , 'Match expected Length' ) ;
175204 assert . equal ( links [ 0 ] . tooltip , Repl . launchNativeRepl , 'Expected tooltip to be Launch VS Code Native REPL' ) ;
176205 }
177206 } ) ;
0 commit comments