File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
test/Microsoft.NET.Restore.Tests Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -161,5 +161,26 @@ public void SeparateRestoreCommand_respects_user_EnableDefaultItems()
161161 restoreArgs . Should ( ) . NotContain ( $ "-property:{ Constants . EnableDefaultItems } =false") ;
162162 restoreArgs . Should ( ) . Contain ( "-property:EnableDefaultItems=true" ) ;
163163 }
164+
165+ [ Fact ]
166+ public void Optimization_only_affects_restore_operations ( )
167+ {
168+ // This test verifies that the optimization is only applied in restore contexts
169+ // and doesn't affect other MSBuild operations
170+
171+ // The optimization should only be applied in:
172+ // 1. RestoreCommand.CreateForwarding (explicit restore)
173+ // 2. RestoringCommand.GetSeparateRestoreCommand (implicit restore)
174+ //
175+ // It should NOT be applied to regular build commands that don't involve restore
176+
177+ // For now, this is verified by code inspection since our optimization is only
178+ // applied in restore-specific code paths. If in the future other commands
179+ // start using Constants.AddRestoreOptimizations, we would need to ensure
180+ // they only do so in restore contexts.
181+
182+ // This test serves as documentation of the intended scope
183+ Assert . True ( true , "Optimization scope is currently limited to restore commands by design" ) ;
184+ }
164185 }
165186}
You can’t perform that action at this time.
0 commit comments