@@ -105,6 +105,13 @@ function runValidateAll(workspaceRoot) {
105105 } )
106106}
107107
108+ function runValidateCurrent ( workspaceRoot ) {
109+ return spawnSync ( process . execPath , [ ALL_SCRIPT , '--workspace' , workspaceRoot , '--current-only' ] , {
110+ cwd : workspaceRoot ,
111+ encoding : 'utf8'
112+ } )
113+ }
114+
108115function createWorkspaceNamespaceWorkspace ( projectInfo ) {
109116 const root = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , 'devcodex-validate-profile-ws-' ) )
110117 TEMP_ROOTS . push ( root )
@@ -1245,6 +1252,26 @@ function main() {
12451252
12461253 assert . strictEqual ( allProfilesResult . status , 0 , allProfilesOutput )
12471254 assert . match ( allProfilesOutput , / c h e c k e d = 2 / )
1255+
1256+ const currentOnlyRoot = createWorkspaceNamespaceWorkspace ( currentProjectInfo ( ) )
1257+ writeFile ( currentOnlyRoot , '.devcodex/devcodex/profile/01-项目信息.md' , currentProjectInfo ( ) )
1258+ writeFile ( currentOnlyRoot , '.devcodex/chat/profile/01-项目信息.md' , [
1259+ currentProjectInfo ( ) ,
1260+ '' ,
1261+ '- Profile 档位:profile-standard。'
1262+ ] . join ( '\n' ) )
1263+ const currentOnlyResult = runValidateCurrent ( currentOnlyRoot )
1264+ const currentOnlyOutput = `${ currentOnlyResult . stdout } \n${ currentOnlyResult . stderr } `
1265+ assert . strictEqual ( currentOnlyResult . status , 0 , currentOnlyOutput )
1266+ assert . match ( currentOnlyOutput , / \[ p r o f i l e - c u r r e n t \] c u r r e n t - p r o j e c t = d e v c o d e x c h e c k e d = 1 e r r o r s = 0 w a r n i n g s = 0 / )
1267+ assert . doesNotMatch ( currentOnlyOutput , / w o r k s p a c e - d e b t / )
1268+
1269+ const workspaceDebtResult = runValidateAll ( currentOnlyRoot )
1270+ const workspaceDebtOutput = `${ workspaceDebtResult . stdout } \n${ workspaceDebtResult . stderr } `
1271+ assert . strictEqual ( workspaceDebtResult . status , 1 , workspaceDebtOutput )
1272+ assert . match ( workspaceDebtOutput , / \[ p r o f i l e - a l l \] c u r r e n t - p r o j e c t = d e v c o d e x c h e c k e d = 1 e r r o r s = 0 w a r n i n g s = 0 / )
1273+ assert . match ( workspaceDebtOutput , / \[ p r o f i l e - a l l \] w o r k s p a c e - d e b t c h e c k e d = 2 e r r o r s = 1 w a r n i n g s = 0 / )
1274+ assert . match ( workspaceDebtOutput , / p r o f i l e - s t a n d a r d r e q u i r e s 0 4 - 测 试 规 范 \. m d / )
12481275 const batchEResult = spawnSync ( process . execPath , [ path . join ( ROOT , 'scripts' , 'test-v1178-batch-e.js' ) ] , {
12491276 cwd : ROOT ,
12501277 encoding : 'utf8'
0 commit comments