14
14
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
// *****************************************************************************
16
16
17
- import { expect } from 'chai ' ;
17
+ import { Severity } from '@theia/core/lib/common/severity ' ;
18
18
import { DiagnosticSeverity } from '@theia/core/shared/vscode-languageserver-protocol' ;
19
- import { ProblemCollector } from './task-problem-collector ' ;
19
+ import { expect } from 'chai ' ;
20
20
import { ApplyToKind , FileLocationKind , ProblemLocationKind , ProblemMatch , ProblemMatchData , ProblemMatcher } from '../common/problem-matcher-protocol' ;
21
- import { Severity } from '@theia/core/lib/common/severity ' ;
21
+ import { ProblemCollector } from './task-problem-collector ' ;
22
22
23
23
const startStopMatcher1 : ProblemMatcher = {
24
24
owner : 'test1' ,
@@ -130,23 +130,23 @@ describe('ProblemCollector', () => {
130
130
131
131
expect ( allMatches . length ) . to . eq ( 3 ) ;
132
132
133
- expect ( ( allMatches [ 0 ] as ProblemMatchData ) . resource ! . path ) . eq ( '/home/test/hello.go' ) ;
133
+ expect ( ( allMatches [ 0 ] as ProblemMatchData ) . resource ! . path . toString ( ) ) . eq ( '/home/test/hello.go' ) ;
134
134
expect ( ( allMatches [ 0 ] as ProblemMatchData ) . marker ) . deep . equal ( {
135
135
range : { start : { line : 8 , character : 1 } , end : { line : 8 , character : 1 } } ,
136
136
severity : DiagnosticSeverity . Error ,
137
137
source : 'test1' ,
138
138
message : 'undefined: fmt.Pntln'
139
139
} ) ;
140
140
141
- expect ( ( allMatches [ 1 ] as ProblemMatchData ) . resource ! . path ) . eq ( '/home/test/hello.go' ) ;
141
+ expect ( ( allMatches [ 1 ] as ProblemMatchData ) . resource ! . path . toString ( ) ) . eq ( '/home/test/hello.go' ) ;
142
142
expect ( ( allMatches [ 1 ] as ProblemMatchData ) . marker ) . deep . equal ( {
143
143
range : { start : { line : 9 , character : 5 } , end : { line : 9 , character : 5 } } ,
144
144
severity : DiagnosticSeverity . Error ,
145
145
source : 'test1' ,
146
146
message : 'undefined: numb'
147
147
} ) ;
148
148
149
- expect ( ( allMatches [ 2 ] as ProblemMatchData ) . resource ! . path ) . eq ( '/home/test/hello.go' ) ;
149
+ expect ( ( allMatches [ 2 ] as ProblemMatchData ) . resource ! . path . toString ( ) ) . eq ( '/home/test/hello.go' ) ;
150
150
expect ( ( allMatches [ 2 ] as ProblemMatchData ) . marker ) . deep . equal ( {
151
151
range : { start : { line : 14 , character : 8 } , end : { line : 14 , character : 8 } } ,
152
152
severity : DiagnosticSeverity . Error ,
@@ -176,7 +176,7 @@ describe('ProblemCollector', () => {
176
176
177
177
expect ( allMatches . length ) . to . eq ( 4 ) ;
178
178
179
- expect ( ( allMatches [ 0 ] as ProblemMatchData ) . resource ! . path ) . eq ( '/home/test/test-dir.js' ) ;
179
+ expect ( ( allMatches [ 0 ] as ProblemMatchData ) . resource ! . path . toString ( ) ) . eq ( '/home/test/test-dir.js' ) ;
180
180
expect ( ( allMatches [ 0 ] as ProblemMatchData ) . marker ) . deep . equal ( {
181
181
range : { start : { line : 13 , character : 20 } , end : { line : 13 , character : 20 } } ,
182
182
severity : DiagnosticSeverity . Warning ,
@@ -185,7 +185,7 @@ describe('ProblemCollector', () => {
185
185
code : 'semi'
186
186
} ) ;
187
187
188
- expect ( ( allMatches [ 1 ] as ProblemMatchData ) . resource ! . path ) . eq ( '/home/test/test-dir.js' ) ;
188
+ expect ( ( allMatches [ 1 ] as ProblemMatchData ) . resource ! . path . toString ( ) ) . eq ( '/home/test/test-dir.js' ) ;
189
189
expect ( ( allMatches [ 1 ] as ProblemMatchData ) . marker ) . deep . equal ( {
190
190
range : { start : { line : 14 , character : 22 } , end : { line : 14 , character : 22 } } ,
191
191
severity : DiagnosticSeverity . Warning ,
@@ -194,15 +194,15 @@ describe('ProblemCollector', () => {
194
194
code : 'semi'
195
195
} ) ;
196
196
197
- expect ( ( allMatches [ 2 ] as ProblemMatchData ) . resource ! . path ) . eq ( '/home/test/test-dir.js' ) ;
197
+ expect ( ( allMatches [ 2 ] as ProblemMatchData ) . resource ! . path . toString ( ) ) . eq ( '/home/test/test-dir.js' ) ;
198
198
expect ( ( allMatches [ 2 ] as ProblemMatchData ) . marker ) . deep . equal ( {
199
199
range : { start : { line : 102 , character : 8 } , end : { line : 102 , character : 8 } } ,
200
200
severity : DiagnosticSeverity . Error ,
201
201
source : 'test2' ,
202
202
message : 'Parsing error: Unexpected token inte'
203
203
} ) ;
204
204
205
- expect ( ( allMatches [ 3 ] as ProblemMatchData ) . resource ! . path ) . eq ( '/home/test/more-test.js' ) ;
205
+ expect ( ( allMatches [ 3 ] as ProblemMatchData ) . resource ! . path . toString ( ) ) . eq ( '/home/test/more-test.js' ) ;
206
206
expect ( ( allMatches [ 3 ] as ProblemMatchData ) . marker ) . deep . equal ( {
207
207
range : { start : { line : 12 , character : 8 } , end : { line : 12 , character : 8 } } ,
208
208
severity : DiagnosticSeverity . Error ,
@@ -232,7 +232,7 @@ describe('ProblemCollector', () => {
232
232
233
233
expect ( allMatches . length ) . to . eq ( 4 ) ;
234
234
235
- expect ( ( allMatches [ 0 ] as ProblemMatchData ) . resource ?. path ) . eq ( '/home/test/test-dir.js' ) ;
235
+ expect ( ( allMatches [ 0 ] as ProblemMatchData ) . resource ?. path . toString ( ) ) . eq ( '/home/test/test-dir.js' ) ;
236
236
expect ( ( allMatches [ 0 ] as ProblemMatchData ) . marker ) . deep . equal ( {
237
237
range : { start : { line : 0 , character : 0 } , end : { line : 0 , character : 0 } } ,
238
238
severity : DiagnosticSeverity . Warning ,
@@ -241,7 +241,7 @@ describe('ProblemCollector', () => {
241
241
code : 'semi'
242
242
} ) ;
243
243
244
- expect ( ( allMatches [ 1 ] as ProblemMatchData ) . resource ?. path ) . eq ( '/home/test/test-dir.js' ) ;
244
+ expect ( ( allMatches [ 1 ] as ProblemMatchData ) . resource ?. path . toString ( ) ) . eq ( '/home/test/test-dir.js' ) ;
245
245
expect ( ( allMatches [ 1 ] as ProblemMatchData ) . marker ) . deep . equal ( {
246
246
range : { start : { line : 0 , character : 0 } , end : { line : 0 , character : 0 } } ,
247
247
severity : DiagnosticSeverity . Warning ,
@@ -250,15 +250,15 @@ describe('ProblemCollector', () => {
250
250
code : 'semi'
251
251
} ) ;
252
252
253
- expect ( ( allMatches [ 2 ] as ProblemMatchData ) . resource ?. path ) . eq ( '/home/test/test-dir.js' ) ;
253
+ expect ( ( allMatches [ 2 ] as ProblemMatchData ) . resource ?. path . toString ( ) ) . eq ( '/home/test/test-dir.js' ) ;
254
254
expect ( ( allMatches [ 2 ] as ProblemMatchData ) . marker ) . deep . equal ( {
255
255
range : { start : { line : 0 , character : 0 } , end : { line : 0 , character : 0 } } ,
256
256
severity : DiagnosticSeverity . Error ,
257
257
source : 'test2' ,
258
258
message : 'Parsing error: Unexpected token inte'
259
259
} ) ;
260
260
261
- expect ( ( allMatches [ 3 ] as ProblemMatchData ) . resource ?. path ) . eq ( '/home/test/more-test.js' ) ;
261
+ expect ( ( allMatches [ 3 ] as ProblemMatchData ) . resource ?. path . toString ( ) ) . eq ( '/home/test/more-test.js' ) ;
262
262
expect ( ( allMatches [ 3 ] as ProblemMatchData ) . marker ) . deep . equal ( {
263
263
range : { start : { line : 0 , character : 0 } , end : { line : 0 , character : 0 } } ,
264
264
severity : DiagnosticSeverity . Error ,
0 commit comments