@@ -26,32 +26,40 @@ describe('The Clang provider for AtomLinter', () => {
26
26
const editor = await atom . workspace . open ( `${ miPath } .c` ) ;
27
27
const messages = await lint ( editor ) ;
28
28
expect ( messages . length ) . toBe ( 1 ) ;
29
- expect ( messages [ 0 ] . type ) . toBe ( 'fatal error' ) ;
30
- expect ( messages [ 0 ] . text ) . toBe ( "'nothing.h' file not found" ) ;
29
+ expect ( messages [ 0 ] . severity ) . toBe ( 'error' ) ;
30
+ expect ( messages [ 0 ] . excerpt ) . toBe ( "'nothing.h' file not found" ) ;
31
+ expect ( messages [ 0 ] . location . file ) . toBe ( `${ miPath } .c` ) ;
32
+ expect ( messages [ 0 ] . location . position ) . toEqual ( [ [ 1 , 9 ] , [ 1 , 17 ] ] ) ;
31
33
} ) ;
32
34
33
35
it ( 'finds a fatal error in "missing_import.cpp"' , async ( ) => {
34
36
const editor = await atom . workspace . open ( `${ miPath } .cpp` ) ;
35
37
const messages = await lint ( editor ) ;
36
38
expect ( messages . length ) . toBe ( 1 ) ;
37
- expect ( messages [ 0 ] . type ) . toEqual ( 'fatal error' ) ;
38
- expect ( messages [ 0 ] . text ) . toEqual ( "'nothing.h' file not found" ) ;
39
+ expect ( messages [ 0 ] . severity ) . toBe ( 'error' ) ;
40
+ expect ( messages [ 0 ] . excerpt ) . toBe ( "'nothing.h' file not found" ) ;
41
+ expect ( messages [ 0 ] . location . file ) . toBe ( `${ miPath } .cpp` ) ;
42
+ expect ( messages [ 0 ] . location . position ) . toEqual ( [ [ 1 , 9 ] , [ 1 , 17 ] ] ) ;
39
43
} ) ;
40
44
41
45
it ( 'finds a fatal error in "missing_import.m"' , async ( ) => {
42
46
const editor = await atom . workspace . open ( `${ miPath } .m` ) ;
43
47
const messages = await lint ( editor ) ;
44
48
expect ( messages . length ) . toBe ( 1 ) ;
45
- expect ( messages [ 0 ] . type ) . toEqual ( 'fatal error' ) ;
46
- expect ( messages [ 0 ] . text ) . toEqual ( "'nothing.h' file not found" ) ;
49
+ expect ( messages [ 0 ] . severity ) . toBe ( 'error' ) ;
50
+ expect ( messages [ 0 ] . excerpt ) . toBe ( "'nothing.h' file not found" ) ;
51
+ expect ( messages [ 0 ] . location . file ) . toBe ( `${ miPath } .m` ) ;
52
+ expect ( messages [ 0 ] . location . position ) . toEqual ( [ [ 1 , 9 ] , [ 1 , 17 ] ] ) ;
47
53
} ) ;
48
54
49
55
it ( 'finds a fatal error in "missing_import.mm"' , async ( ) => {
50
56
const editor = await atom . workspace . open ( `${ miPath } .mm` ) ;
51
57
const messages = await lint ( editor ) ;
52
58
expect ( messages . length ) . toBe ( 1 ) ;
53
- expect ( messages [ 0 ] . type ) . toEqual ( 'fatal error' ) ;
54
- expect ( messages [ 0 ] . text ) . toEqual ( "'nothing.h' file not found" ) ;
59
+ expect ( messages [ 0 ] . severity ) . toBe ( 'error' ) ;
60
+ expect ( messages [ 0 ] . excerpt ) . toBe ( "'nothing.h' file not found" ) ;
61
+ expect ( messages [ 0 ] . location . file ) . toBe ( `${ miPath } .mm` ) ;
62
+ expect ( messages [ 0 ] . location . position ) . toEqual ( [ [ 1 , 9 ] , [ 1 , 17 ] ] ) ;
55
63
} ) ;
56
64
} ) ;
57
65
} ) ;
0 commit comments