@@ -354,5 +354,26 @@ suite('TerminalCompletionModel', function () {
354
354
{ label : "feature-branch" , description : "Feature branch" } ,
355
355
] ) ;
356
356
} ) ;
357
+
358
+ test ( 'should not prioritize branches with similar names' , ( ) => {
359
+ const items = [
360
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : 'mainline' } ) ,
361
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : 'masterpiece' } ) ,
362
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : 'main' } ) ,
363
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : 'master' } )
364
+ ] ;
365
+ const model = new TerminalCompletionModel ( items , new LineContext ( 'git checkout ' , 0 ) ) ;
366
+ assertItems ( model , [ 'main' , 'master' , 'mainline' , 'masterpiece' ] ) ;
367
+ } ) ;
368
+
369
+ test ( 'should prioritize for git branch -d' , ( ) => {
370
+ const items = [
371
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : 'main' } ) ,
372
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : 'master' } ) ,
373
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : 'dev' } )
374
+ ] ;
375
+ const model = new TerminalCompletionModel ( items , new LineContext ( 'git branch -d ' , 0 ) ) ;
376
+ assertItems ( model , [ 'main' , 'master' , 'dev' ] ) ;
377
+ } ) ;
357
378
} ) ;
358
379
} ) ;
0 commit comments