@@ -10,6 +10,8 @@ import { IRawFileWorkspaceFolder } from 'vs/platform/workspaces/common/workspace
1010
1111suite ( 'Workspace' , ( ) => {
1212
13+ const workspaceConfigPath = URI . file ( '/src/test.code-workspace' ) ;
14+
1315 test ( 'getFolder returns the folder with given uri' , ( ) => {
1416 const expected = new WorkspaceFolder ( { uri : URI . file ( '/src/test' ) , name : '' , index : 2 } ) ;
1517 let testObject = new Workspace ( '' , [ new WorkspaceFolder ( { uri : URI . file ( '/src/main' ) , name : '' , index : 0 } ) , expected , new WorkspaceFolder ( { uri : URI . file ( '/src/code' ) , name : '' , index : 2 } ) ] ) ;
@@ -46,7 +48,7 @@ suite('Workspace', () => {
4648 } ) ;
4749
4850 test ( 'toWorkspaceFolders with single absolute folder' , ( ) => {
49- const actual = toWorkspaceFolders ( [ { path : '/src/test' } ] , URI . file ( '/workspaces' ) ) ;
51+ const actual = toWorkspaceFolders ( [ { path : '/src/test' } ] , workspaceConfigPath ) ;
5052
5153 assert . equal ( actual . length , 1 ) ;
5254 assert . equal ( actual [ 0 ] . uri . fsPath , URI . file ( '/src/test' ) . fsPath ) ;
@@ -56,7 +58,7 @@ suite('Workspace', () => {
5658 } ) ;
5759
5860 test ( 'toWorkspaceFolders with single relative folder' , ( ) => {
59- const actual = toWorkspaceFolders ( [ { path : './test' } ] , URI . file ( 'src' ) ) ;
61+ const actual = toWorkspaceFolders ( [ { path : './test' } ] , workspaceConfigPath ) ;
6062
6163 assert . equal ( actual . length , 1 ) ;
6264 assert . equal ( actual [ 0 ] . uri . fsPath , URI . file ( '/src/test' ) . fsPath ) ;
@@ -66,7 +68,7 @@ suite('Workspace', () => {
6668 } ) ;
6769
6870 test ( 'toWorkspaceFolders with single absolute folder with name' , ( ) => {
69- const actual = toWorkspaceFolders ( [ { path : '/src/test' , name : 'hello' } ] , URI . file ( '/workspaces' ) ) ;
71+ const actual = toWorkspaceFolders ( [ { path : '/src/test' , name : 'hello' } ] , workspaceConfigPath ) ;
7072
7173 assert . equal ( actual . length , 1 ) ;
7274
@@ -77,7 +79,7 @@ suite('Workspace', () => {
7779 } ) ;
7880
7981 test ( 'toWorkspaceFolders with multiple unique absolute folders' , ( ) => {
80- const actual = toWorkspaceFolders ( [ { path : '/src/test2' } , { path : '/src/test3' } , { path : '/src/test1' } ] , URI . file ( '/workspaces' ) ) ;
82+ const actual = toWorkspaceFolders ( [ { path : '/src/test2' } , { path : '/src/test3' } , { path : '/src/test1' } ] , workspaceConfigPath ) ;
8183
8284 assert . equal ( actual . length , 3 ) ;
8385 assert . equal ( actual [ 0 ] . uri . fsPath , URI . file ( '/src/test2' ) . fsPath ) ;
@@ -97,7 +99,7 @@ suite('Workspace', () => {
9799 } ) ;
98100
99101 test ( 'toWorkspaceFolders with multiple unique absolute folders with names' , ( ) => {
100- const actual = toWorkspaceFolders ( [ { path : '/src/test2' } , { path : '/src/test3' , name : 'noName' } , { path : '/src/test1' } ] , URI . file ( '/workspaces' ) ) ;
102+ const actual = toWorkspaceFolders ( [ { path : '/src/test2' } , { path : '/src/test3' , name : 'noName' } , { path : '/src/test1' } ] , workspaceConfigPath ) ;
101103
102104 assert . equal ( actual . length , 3 ) ;
103105 assert . equal ( actual [ 0 ] . uri . fsPath , URI . file ( '/src/test2' ) . fsPath ) ;
@@ -117,7 +119,7 @@ suite('Workspace', () => {
117119 } ) ;
118120
119121 test ( 'toWorkspaceFolders with multiple unique absolute and relative folders' , ( ) => {
120- const actual = toWorkspaceFolders ( [ { path : '/src/test2' } , { path : '/abc/test3' , name : 'noName' } , { path : './test1' } ] , URI . file ( 'src' ) ) ;
122+ const actual = toWorkspaceFolders ( [ { path : '/src/test2' } , { path : '/abc/test3' , name : 'noName' } , { path : './test1' } ] , workspaceConfigPath ) ;
121123
122124 assert . equal ( actual . length , 3 ) ;
123125 assert . equal ( actual [ 0 ] . uri . fsPath , URI . file ( '/src/test2' ) . fsPath ) ;
@@ -137,7 +139,7 @@ suite('Workspace', () => {
137139 } ) ;
138140
139141 test ( 'toWorkspaceFolders with multiple absolute folders with duplicates' , ( ) => {
140- const actual = toWorkspaceFolders ( [ { path : '/src/test2' } , { path : '/src/test2' , name : 'noName' } , { path : '/src/test1' } ] , URI . file ( '/workspaces' ) ) ;
142+ const actual = toWorkspaceFolders ( [ { path : '/src/test2' } , { path : '/src/test2' , name : 'noName' } , { path : '/src/test1' } ] , workspaceConfigPath ) ;
141143
142144 assert . equal ( actual . length , 2 ) ;
143145 assert . equal ( actual [ 0 ] . uri . fsPath , URI . file ( '/src/test2' ) . fsPath ) ;
@@ -152,7 +154,7 @@ suite('Workspace', () => {
152154 } ) ;
153155
154156 test ( 'toWorkspaceFolders with multiple absolute and relative folders with duplicates' , ( ) => {
155- const actual = toWorkspaceFolders ( [ { path : '/src/test2' } , { path : '/src/test3' , name : 'noName' } , { path : './test3' } , { path : '/abc/test1' } ] , URI . file ( 'src' ) ) ;
157+ const actual = toWorkspaceFolders ( [ { path : '/src/test2' } , { path : '/src/test3' , name : 'noName' } , { path : './test3' } , { path : '/abc/test1' } ] , workspaceConfigPath ) ;
156158
157159 assert . equal ( actual . length , 3 ) ;
158160 assert . equal ( actual [ 0 ] . uri . fsPath , URI . file ( '/src/test2' ) . fsPath ) ;
@@ -172,7 +174,7 @@ suite('Workspace', () => {
172174 } ) ;
173175
174176 test ( 'toWorkspaceFolders with multiple absolute and relative folders with invalid paths' , ( ) => {
175- const actual = toWorkspaceFolders ( [ { path : '/src/test2' } , { path : '' , name : 'noName' } , { path : './test3' } , { path : '/abc/test1' } ] , URI . file ( 'src' ) ) ;
177+ const actual = toWorkspaceFolders ( [ { path : '/src/test2' } , { path : '' , name : 'noName' } , { path : './test3' } , { path : '/abc/test1' } ] , workspaceConfigPath ) ;
176178
177179 assert . equal ( actual . length , 3 ) ;
178180 assert . equal ( actual [ 0 ] . uri . fsPath , URI . file ( '/src/test2' ) . fsPath ) ;
0 commit comments