@@ -245,7 +245,7 @@ describe('SolutionProblems', () => {
245245 logMessages : {
246246 success : true ,
247247 errors : [ ] ,
248- warnings : [ "mylayer.clayer.yml - file '/packs/Component/config.c' update required from component 'Arm::Device@2.3.4'" ] ,
248+ warnings : [ "mylayer.clayer.yml - update required for file '/packs/Component/config.c' from component 'Arm::Device@2.3.4'" ] ,
249249 info : [ ] ,
250250 } ,
251251 } ) ;
@@ -272,7 +272,7 @@ describe('SolutionProblems', () => {
272272
273273 it ( 'creates merge diagnostic action for merge messages with component context' , ( ) => {
274274 const result = solutionProblems [ 'createMergeDiagnosticAction' ] (
275- "file '/packs/Component/config.c' update required from component 'Arm::Device@2.3.4'" ,
275+ "update required for file '/packs/Component/config.c' from component 'Arm::Device@2.3.4'" ,
276276 layerPath ,
277277 ) ;
278278
@@ -285,6 +285,27 @@ describe('SolutionProblems', () => {
285285 } ) ;
286286 } ) ;
287287
288+ it ( 'creates merge diagnostic action for current toolbox message wording' , ( ) => {
289+ const configPath = 'C:/CubeMX/CubeMX/RTE/CMSIS/RTX_Config.c' ;
290+ const result = solutionProblems [ 'createMergeDiagnosticAction' ] (
291+ `update recommended for file '${ configPath } ' from component 'CMSIS:RTOS2:Keil RTX5&Source'.\nMerge content from update file, rename update file to base file and remove previous base file` ,
292+ layerPath ,
293+ ) ;
294+
295+ expect ( result ) . toEqual ( {
296+ message : "update recommended for config file 'RTX_Config.c' from component 'CMSIS:RTOS2:Keil RTX5&Source'." ,
297+ code : {
298+ value : 'Open in Merge View' ,
299+ target : vscode . Uri . parse ( `command:${ MERGE_FILE_COMMAND_ID } ?${ encodeURIComponent ( JSON . stringify ( [ configPath ] ) ) } ` ) ,
300+ } ,
301+ } ) ;
302+ } ) ;
303+
304+ it ( 'treats Windows-style merge paths as absolute' , ( ) => {
305+ expect ( solutionProblems [ 'isAbsoluteFilePath' ] ( 'C:/CubeMX/CubeMX/RTE/CMSIS/RTX_Config.c' ) ) . toBe ( true ) ;
306+ expect ( solutionProblems [ 'isAbsoluteFilePath' ] ( 'relative-config.c' ) ) . toBe ( false ) ;
307+ } ) ;
308+
288309 it ( 'returns undefined merge diagnostic action for non-merge messages' , ( ) => {
289310 const result = solutionProblems [ 'createMergeDiagnosticAction' ] (
290311 "component 'Arm::Device@2.3.4' is missing" ,
@@ -304,7 +325,7 @@ describe('SolutionProblems', () => {
304325 logMessages : {
305326 success : true ,
306327 errors : [ ] ,
307- warnings : [ "mylayer.clayer.yml - file 'relative-config.c' update recommended " ] ,
328+ warnings : [ "mylayer.clayer.yml - update recommended for file 'relative-config.c'" ] ,
308329 info : [ ] ,
309330 } ,
310331 } ) ;
@@ -323,7 +344,7 @@ describe('SolutionProblems', () => {
323344 } ) ;
324345
325346 it . each ( [ 'required' , 'recommended' , 'suggested' , 'mandatory' ] as const ) (
326- 'renders merge diagnostics for %s update levels' ,
347+ 'renders merge diagnostics for current toolbox wording with %s update levels' ,
327348 async updateLevel => {
328349 await solutionProblems . activate ( { subscriptions : [ ] } as unknown as ExtensionContext ) ;
329350 const setSpy = jest . spyOn ( vscode . languages . createDiagnosticCollection ( ) , 'set' ) ;
@@ -334,7 +355,7 @@ describe('SolutionProblems', () => {
334355 logMessages : {
335356 success : true ,
336357 errors : [ ] ,
337- warnings : [ `mylayer.clayer.yml - file '/packs/Component/${ updateLevel } .c' update ${ updateLevel } ` ] ,
358+ warnings : [ `mylayer.clayer.yml - update ${ updateLevel } for file '/packs/Component/${ updateLevel } .c'; merge content from update file, rename update file to base file and remove previous base file ` ] ,
338359 info : [ ] ,
339360 } ,
340361 } ) ;
0 commit comments