@@ -74,6 +74,26 @@ suite('Linter integration', () => {
74
74
deepStrictEqual ( paths , refs ) ;
75
75
} ) ;
76
76
77
+ test ( 'Linter user setting returns the right linter internally' , ( ) => {
78
+ const names = [ 'gfortran' , 'ifort' , 'ifx' , 'nagfor' , 'fake' ] ;
79
+ for ( const n of names ) {
80
+ const compiler = linter [ 'getLinter' ] ( n ) ;
81
+ if ( n === 'gfortran' ) {
82
+ if ( linter [ 'settings' ] . modernGNU ) {
83
+ strictEqual ( compiler instanceof GNUModernLinter , true ) ;
84
+ } else {
85
+ strictEqual ( compiler instanceof GNULinter , true ) ;
86
+ }
87
+ } else if ( n === 'ifort' || n === 'ifx' ) {
88
+ strictEqual ( compiler instanceof IntelLinter , true ) ;
89
+ } else if ( n === 'nagfor' ) {
90
+ strictEqual ( compiler instanceof NAGLinter , true ) ;
91
+ } else {
92
+ strictEqual ( compiler instanceof GNULinter , true ) ;
93
+ }
94
+ }
95
+ } ) ;
96
+
77
97
suiteTeardown ( async function ( ) : Promise < void > {
78
98
await config . update ( 'linter.includePaths' , oldVals , false ) ;
79
99
} ) ;
@@ -122,25 +142,25 @@ C:\\Some\\random\\path\\sample.f90:4:18:
122
142
| 1
123
143
Error: Missing actual argument for argument ‘a’ at (1)
124
144
` ;
125
- // suite('REGEX matches', () => {
126
- // const matches = [...msg.matchAll(linter.regex)];
127
- // const g = matches[0].groups;
128
- // test('REGEX: filename', () => {
129
- // strictEqual(g?.['fname'], 'C:\\Some\\random\\path\\sample.f90');
130
- // });
131
- // test('REGEX: line number', () => {
132
- // strictEqual(g?.['ln'], '4');
133
- // });
134
- // test('REGEX: column number', () => {
135
- // strictEqual(g?.['cn'], '18');
136
- // });
137
- // test('REGEX: severity <sev1>', () => {
138
- // strictEqual(g?.['sev1'], 'Error');
139
- // });
140
- // test('REGEX: message <msg1>', () => {
141
- // strictEqual(g?.['msg1'], 'Missing actual argument for argument ‘a’ at (1)');
142
- // });
143
- // });
145
+ suite ( 'REGEX matches' , ( ) => {
146
+ const matches = [ ...msg . matchAll ( linter . regex ) ] ;
147
+ const g = matches [ 0 ] . groups ;
148
+ test ( 'REGEX: filename' , ( ) => {
149
+ strictEqual ( g ?. [ 'fname' ] , 'C:\\Some\\random\\path\\sample.f90' ) ;
150
+ } ) ;
151
+ test ( 'REGEX: line number' , ( ) => {
152
+ strictEqual ( g ?. [ 'ln' ] , '4' ) ;
153
+ } ) ;
154
+ test ( 'REGEX: column number' , ( ) => {
155
+ strictEqual ( g ?. [ 'cn' ] , '18' ) ;
156
+ } ) ;
157
+ test ( 'REGEX: severity <sev1>' , ( ) => {
158
+ strictEqual ( g ?. [ 'sev1' ] , 'Error' ) ;
159
+ } ) ;
160
+ test ( 'REGEX: message <msg1>' , ( ) => {
161
+ strictEqual ( g ?. [ 'msg1' ] , 'Missing actual argument for argument ‘a’ at (1)' ) ;
162
+ } ) ;
163
+ } ) ;
144
164
test ( 'Diagnostics Array' , ( ) => {
145
165
console . log ( linter . parse ( msg ) ) ;
146
166
const diags = linter . parse ( msg ) ;
0 commit comments