@@ -32,8 +32,20 @@ import { createTextModel } from 'vs/editor/test/common/editorTestUtils';
32
32
import { ILabelService } from 'vs/platform/label/common/label' ;
33
33
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace' ;
34
34
import { minimizeInlineCompletion } from 'vs/editor/contrib/inlineCompletions/inlineCompletionsModel' ;
35
+ import { rangeStartsWith } from 'vs/editor/contrib/inlineCompletions/suggestWidgetInlineCompletionProvider' ;
35
36
36
37
suite ( 'Suggest Widget Model' , ( ) => {
38
+ test ( 'rangeStartsWith' , ( ) => {
39
+ assert . strictEqual ( rangeStartsWith ( new Range ( 1 , 1 , 10 , 5 ) , new Range ( 1 , 1 , 1 , 1 ) ) , true ) ;
40
+ assert . strictEqual ( rangeStartsWith ( new Range ( 1 , 1 , 10 , 5 ) , new Range ( 1 , 1 , 10 , 5 ) ) , true ) ;
41
+ assert . strictEqual ( rangeStartsWith ( new Range ( 1 , 1 , 10 , 5 ) , new Range ( 1 , 1 , 10 , 4 ) ) , true ) ;
42
+ assert . strictEqual ( rangeStartsWith ( new Range ( 1 , 1 , 10 , 5 ) , new Range ( 1 , 1 , 9 , 6 ) ) , true ) ;
43
+
44
+ assert . strictEqual ( rangeStartsWith ( new Range ( 2 , 1 , 10 , 5 ) , new Range ( 1 , 1 , 10 , 5 ) ) , false ) ;
45
+ assert . strictEqual ( rangeStartsWith ( new Range ( 1 , 1 , 10 , 5 ) , new Range ( 1 , 1 , 10 , 6 ) ) , false ) ;
46
+ assert . strictEqual ( rangeStartsWith ( new Range ( 1 , 1 , 10 , 5 ) , new Range ( 1 , 1 , 11 , 4 ) ) , false ) ;
47
+ } ) ;
48
+
37
49
test ( 'Active' , async ( ) => {
38
50
await withAsyncTestCodeEditorAndInlineCompletionsModel ( '' ,
39
51
{ fakeClock : true , provider, } ,
0 commit comments