@@ -146,35 +146,90 @@ suite('Terminal - Shell Integration with PYTHONSTARTUP', () => {
146146
147147 registerTerminalLinkProviderStub . restore ( ) ;
148148 } ) ;
149-
150- test ( 'Verify provideTerminalLinks returns links when context.line contains expectedNativeLink' , ( ) => {
151- const provider = new CustomTerminalLinkProvider ( ) ;
152- const context : TerminalLinkContext = {
153- line : 'Some random string with VS Code Native REPL in it' ,
154- terminal : { } as Terminal ,
155- } ;
156- const token : CancellationToken = {
157- isCancellationRequested : false ,
158- onCancellationRequested : new EventEmitter < unknown > ( ) . event ,
159- } ;
160-
161- const links = provider . provideTerminalLinks ( context , token ) ;
162-
163- assert . isNotNull ( links , 'Expected links to be not undefined' ) ;
164- assert . isArray ( links , 'Expected links to be an array' ) ;
165- assert . isNotEmpty ( links , 'Expected links to be not empty' ) ;
166-
167- if ( Array . isArray ( links ) ) {
168- assert . equal ( links [ 0 ] . command , 'python.startNativeREPL' , 'Expected command to be python.startNativeREPL' ) ;
169- assert . equal (
170- links [ 0 ] . startIndex ,
171- context . line . indexOf ( 'VS Code Native REPL' ) ,
172- 'Expected startIndex to be 0' ,
173- ) ;
174- assert . equal ( links [ 0 ] . length , 'VS Code Native REPL' . length , 'Expected length to be 16' ) ;
175- assert . equal ( links [ 0 ] . tooltip , Repl . launchNativeRepl , 'Expected tooltip to be Launch VS Code Native REPL' ) ;
176- }
177- } ) ;
149+ if ( process . platform === 'darwin' ) {
150+ test ( 'Mac - Verify provideTerminalLinks returns links when context.line contains expectedNativeLink' , ( ) => {
151+ const provider = new CustomTerminalLinkProvider ( ) ;
152+ const context : TerminalLinkContext = {
153+ line : 'Some random string with Cmd click to launch VS Code Native REPL' ,
154+ terminal : { } as Terminal ,
155+ } ;
156+ const token : CancellationToken = {
157+ isCancellationRequested : false ,
158+ onCancellationRequested : new EventEmitter < unknown > ( ) . event ,
159+ } ;
160+
161+ const links = provider . provideTerminalLinks ( context , token ) ;
162+
163+ assert . isNotNull ( links , 'Expected links to be not undefined' ) ;
164+ assert . isArray ( links , 'Expected links to be an array' ) ;
165+ assert . isNotEmpty ( links , 'Expected links to be not empty' ) ;
166+
167+ if ( Array . isArray ( links ) ) {
168+ assert . equal (
169+ links [ 0 ] . command ,
170+ 'python.startNativeREPL' ,
171+ 'Expected command to be python.startNativeREPL' ,
172+ ) ;
173+ assert . equal (
174+ links [ 0 ] . startIndex ,
175+ context . line . indexOf ( 'Cmd click to launch VS Code Native REPL' ) ,
176+ 'start index should match' ,
177+ ) ;
178+ assert . equal (
179+ links [ 0 ] . length ,
180+ 'Cmd click to launch VS Code Native REPL' . length ,
181+ 'Match expected length' ,
182+ ) ;
183+ assert . equal (
184+ links [ 0 ] . tooltip ,
185+ Repl . launchNativeRepl ,
186+ 'Expected tooltip to be Launch VS Code Native REPL' ,
187+ ) ;
188+ }
189+ } ) ;
190+ }
191+ if ( process . platform !== 'darwin' ) {
192+ test ( 'Windows/Linux - Verify provideTerminalLinks returns links when context.line contains expectedNativeLink' , ( ) => {
193+ const provider = new CustomTerminalLinkProvider ( ) ;
194+ const context : TerminalLinkContext = {
195+ line : 'Some random string with Ctrl click to launch VS Code Native REPL' ,
196+ terminal : { } as Terminal ,
197+ } ;
198+ const token : CancellationToken = {
199+ isCancellationRequested : false ,
200+ onCancellationRequested : new EventEmitter < unknown > ( ) . event ,
201+ } ;
202+
203+ const links = provider . provideTerminalLinks ( context , token ) ;
204+
205+ assert . isNotNull ( links , 'Expected links to be not undefined' ) ;
206+ assert . isArray ( links , 'Expected links to be an array' ) ;
207+ assert . isNotEmpty ( links , 'Expected links to be not empty' ) ;
208+
209+ if ( Array . isArray ( links ) ) {
210+ assert . equal (
211+ links [ 0 ] . command ,
212+ 'python.startNativeREPL' ,
213+ 'Expected command to be python.startNativeREPL' ,
214+ ) ;
215+ assert . equal (
216+ links [ 0 ] . startIndex ,
217+ context . line . indexOf ( 'Ctrl click to launch VS Code Native REPL' ) ,
218+ 'start index should match' ,
219+ ) ;
220+ assert . equal (
221+ links [ 0 ] . length ,
222+ 'Ctrl click to launch VS Code Native REPL' . length ,
223+ 'Match expected Length' ,
224+ ) ;
225+ assert . equal (
226+ links [ 0 ] . tooltip ,
227+ Repl . launchNativeRepl ,
228+ 'Expected tooltip to be Launch VS Code Native REPL' ,
229+ ) ;
230+ }
231+ } ) ;
232+ }
178233
179234 test ( 'Verify provideTerminalLinks returns no links when context.line does not contain expectedNativeLink' , ( ) => {
180235 const provider = new CustomTerminalLinkProvider ( ) ;
0 commit comments