diff --git a/src/Build.UnitTests/Evaluation/Evaluator_Tests.cs b/src/Build.UnitTests/Evaluation/Evaluator_Tests.cs
index 4f9b2b14f92..117da04ce76 100644
--- a/src/Build.UnitTests/Evaluation/Evaluator_Tests.cs
+++ b/src/Build.UnitTests/Evaluation/Evaluator_Tests.cs
@@ -96,6 +96,41 @@ public void VerifyLoadingImportScenarios(string importParameter, bool shouldSucc
}
}
+ [Theory]
+ [InlineData("(test")]
+ [InlineData("@@@test")]
+ [InlineData(@")(!!test")]
+ public void VerifyItemsUpdateIsHandledForAnyProjectPath(string projectPathCandidate)
+ {
+ using (TestEnvironment env = TestEnvironment.Create())
+ {
+ TransientTestFolder projDirectory = env.CreateFolder(Path.Combine(env.CreateNewTempPath().TempPath, projectPathCandidate), createFolder: true);
+ TransientTestFile projectFile = env.CreateFile(projDirectory, "project.proj", @"
+
+
+
+
+
+
+
+
+
+
+
+ Metadata('NewTestLabels'))"" />
+
+
+");
+ Project project = new(projectFile.Path);
+ MockLogger logger = new();
+ var result = project.Build(logger);
+
+ result.ShouldBeTrue();
+ project.AllEvaluatedItems.Where(ei => ei.ItemType == "ItemCheck" && ei.Metadata.Any(m => m.EvaluatedValue == "Dummy")).ShouldNotBeEmpty();
+ }
+ }
+
// Some of these are also tested elsewhere, but this consolidates related tests in one spot.
public static IEnumerable