@@ -28,6 +28,7 @@ import { UntitledTextEditorModel } from 'vs/workbench/services/untitled/common/u
2828import { NullFileSystemProvider } from 'vs/platform/files/test/common/nullFileSystemProvider' ;
2929import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput' ;
3030import { TestStorageService } from 'vs/workbench/test/common/workbenchTestServices' ;
31+ import { isLinux } from 'vs/base/common/platform' ;
3132
3233const TEST_EDITOR_ID = 'MyTestEditorForEditorService' ;
3334const TEST_EDITOR_INPUT_ID = 'testEditorInputForEditorService' ;
@@ -111,7 +112,7 @@ suite('EditorService', () => {
111112 assert . equal ( visibleEditorChangeEventCounter , 1 ) ;
112113
113114 // Close input
114- await editor ! . group ! . closeEditor ( input ) ;
115+ await editor ? .group ? .closeEditor ( input ) ;
115116
116117 assert . equal ( 0 , service . count ) ;
117118 assert . equal ( 0 , service . getEditors ( EditorsOrder . MOST_RECENTLY_ACTIVE ) . length ) ;
@@ -255,13 +256,13 @@ suite('EditorService', () => {
255256 const fileEditorInput1Again = service . createEditorInput ( { resource : fileResource1 } ) ;
256257 assert . equal ( fileEditorInput1Again , fileEditorInput1 ) ;
257258
258- fileEditorInput1Again ! . dispose ( ) ;
259+ fileEditorInput1Again . dispose ( ) ;
259260
260- assert . ok ( fileEditorInput1 ! . isDisposed ( ) ) ;
261+ assert . ok ( fileEditorInput1 . isDisposed ( ) ) ;
261262
262263 const fileEditorInput1AgainAndAgain = service . createEditorInput ( { resource : fileResource1 } ) ;
263264 assert . notEqual ( fileEditorInput1AgainAndAgain , fileEditorInput1 ) ;
264- assert . ok ( ! fileEditorInput1AgainAndAgain ! . isDisposed ( ) ) ;
265+ assert . ok ( ! fileEditorInput1AgainAndAgain . isDisposed ( ) ) ;
265266
266267 // Cached Input (Resource)
267268 const resource1 = URI . from ( { scheme : 'custom' , path : '/foo/bar/cache1.js' } ) ;
@@ -277,13 +278,13 @@ suite('EditorService', () => {
277278 const input1Again = service . createEditorInput ( { resource : resource1 } ) ;
278279 assert . equal ( input1Again , input1 ) ;
279280
280- input1Again ! . dispose ( ) ;
281+ input1Again . dispose ( ) ;
281282
282- assert . ok ( input1 ! . isDisposed ( ) ) ;
283+ assert . ok ( input1 . isDisposed ( ) ) ;
283284
284285 const input1AgainAndAgain = service . createEditorInput ( { resource : resource1 } ) ;
285286 assert . notEqual ( input1AgainAndAgain , input1 ) ;
286- assert . ok ( ! input1AgainAndAgain ! . isDisposed ( ) ) ;
287+ assert . ok ( ! input1AgainAndAgain . isDisposed ( ) ) ;
287288 } ) ;
288289
289290 test ( 'createEditorInput' , async function ( ) {
@@ -301,6 +302,18 @@ suite('EditorService', () => {
301302 let contentInput = < FileEditorInput > input ;
302303 assert . strictEqual ( contentInput . resource . fsPath , toResource . call ( this , '/index.html' ) . fsPath ) ;
303304
305+ // Untyped Input (file casing)
306+ input = service . createEditorInput ( { resource : toResource . call ( this , '/index.html' ) } ) ;
307+ let inputDifferentCase = service . createEditorInput ( { resource : toResource . call ( this , '/INDEX.html' ) } ) ;
308+
309+ if ( ! isLinux ) {
310+ assert . equal ( input , inputDifferentCase ) ;
311+ assert . equal ( input . resource ?. toString ( ) , inputDifferentCase . resource ?. toString ( ) ) ;
312+ } else {
313+ assert . notEqual ( input , inputDifferentCase ) ;
314+ assert . notEqual ( input . resource ?. toString ( ) , inputDifferentCase . resource ?. toString ( ) ) ;
315+ }
316+
304317 // Typed Input
305318 assert . equal ( service . createEditorInput ( input ) , input ) ;
306319 assert . equal ( service . createEditorInput ( { editor : input } ) , input ) ;
@@ -331,7 +344,7 @@ suite('EditorService', () => {
331344 input = service . createEditorInput ( { contents : 'Hello Untitled' , options : { selection : { startLineNumber : 1 , startColumn : 1 } } } ) ;
332345 assert ( input instanceof UntitledTextEditorInput ) ;
333346 let model = await input . resolve ( ) as UntitledTextEditorModel ;
334- assert . equal ( model . textEditorModel ! . getValue ( ) , 'Hello Untitled' ) ;
347+ assert . equal ( model . textEditorModel ? .getValue ( ) , 'Hello Untitled' ) ;
335348
336349 // Untyped Input (untitled with mode)
337350 input = service . createEditorInput ( { mode, options : { selection : { startLineNumber : 1 , startColumn : 1 } } } ) ;
@@ -446,13 +459,13 @@ suite('EditorService', () => {
446459
447460 assert . equal ( part . activeGroup , rootGroup ) ;
448461 assert . equal ( part . count , 2 ) ;
449- assert . equal ( editor ! . group , part . groups [ 1 ] ) ;
462+ assert . equal ( editor ? .group , part . groups [ 1 ] ) ;
450463
451464 // Open to the side uses existing neighbour group if any
452465 editor = await service . openEditor ( input2 , { pinned : true , preserveFocus : true } , SIDE_GROUP ) ;
453466 assert . equal ( part . activeGroup , rootGroup ) ;
454467 assert . equal ( part . count , 2 ) ;
455- assert . equal ( editor ! . group , part . groups [ 1 ] ) ;
468+ assert . equal ( editor ? .group , part . groups [ 1 ] ) ;
456469
457470 part . dispose ( ) ;
458471 } ) ;
@@ -469,7 +482,7 @@ suite('EditorService', () => {
469482
470483 await service . openEditor ( input1 , { pinned : true } , rootGroup ) ;
471484 let editor = await service . openEditor ( input2 , { pinned : true , preserveFocus : true , activation : EditorActivation . ACTIVATE } , SIDE_GROUP ) ;
472- const sideGroup = editor ! . group ;
485+ const sideGroup = editor ? .group ;
473486
474487 assert . equal ( part . activeGroup , sideGroup ) ;
475488
@@ -527,7 +540,7 @@ suite('EditorService', () => {
527540
528541 // 1.) open, open same, open other, close
529542 let editor = await service . openEditor ( input , { pinned : true } ) ;
530- const group = editor ! . group ! ;
543+ const group = editor ? .group ! ;
531544 assertActiveEditorChangedEvent ( true ) ;
532545 assertVisibleEditorsChangedEvent ( true ) ;
533546
0 commit comments