diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2014-05-12 12:22:35 +0400 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2014-05-15 18:55:17 +0400 |
commit | 45c5657c3e5ef86a7b89e1835c480ed85e49470a (patch) | |
tree | c8589fd2a1c8dee6c6caf248ea9b4dd54c0b9972 /mcs/class/Microsoft.Build/Test | |
parent | 35dda9dacd07c8c32c7b163434caef2611d8628f (diff) |
[MS.Build] add another expression expansion test.
Diffstat (limited to 'mcs/class/Microsoft.Build/Test')
-rw-r--r-- | mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectInstanceTest.cs | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectInstanceTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectInstanceTest.cs index 73fbf11b5f7..d3a7af4a035 100644 --- a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectInstanceTest.cs +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectInstanceTest.cs @@ -198,8 +198,8 @@ namespace MonoTests.Microsoft.Build.Execution <UsingTask AssemblyFile='{0}' TaskName='NonExistent' /> <Target Name='X' /> </Project>", thisAssembly); - var xml = XmlReader.Create (new StringReader (project_xml)); - var root = ProjectRootElement.Create (xml); + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); root.FullPath = "ProjectInstanceTest.MissingTypeForUsingTaskStillWorks.proj"; var proj = new ProjectInstance (root); Assert.IsTrue (proj.Build (), "#1"); @@ -219,6 +219,23 @@ namespace MonoTests.Microsoft.Build.Execution var proj = new ProjectInstance (root); Assert.IsTrue (proj.Build (), "#1"); } + + [Test] + public void ExpandStringWithMetadata () + { + string thisAssembly = new Uri (GetType ().Assembly.CodeBase).LocalPath; + string project_xml = string.Format (@"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <ItemGroup> + <Foo Include='xxx'><M>x</M></Foo> + <Foo Include='yyy'><M>y</M></Foo> + </ItemGroup> +</Project>", thisAssembly); + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + root.FullPath = "ProjectInstanceTest.ExpandStringWithMetadata.proj"; + var proj = new ProjectInstance (root); + Assert.AreEqual ("xxx;yyy", proj.ExpandString ("@(FOO)"), "#1"); // so, metadata is gone... + } } namespace SubNamespace |