diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2014-01-31 16:11:17 +0400 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2014-02-20 13:23:02 +0400 |
commit | c57e14c21c6614b843c9666f993f3dc7405a383b (patch) | |
tree | 91046c58be31429bfbef6c8a3c316278fbae70d5 /mcs/class/Microsoft.Build/Test | |
parent | 295ea83b32ba8e7c9435d2470c8b9e9eb7093835 (diff) |
Fix item expression parsing, indexes were wrong to parse after "->" .
Diffstat (limited to 'mcs/class/Microsoft.Build/Test')
-rw-r--r-- | mcs/class/Microsoft.Build/Test/Microsoft.Build.Internal/ExpressionParserTest.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Internal/ExpressionParserTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Internal/ExpressionParserTest.cs index 7654538a1a4..89feec3399f 100644 --- a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Internal/ExpressionParserTest.cs +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Internal/ExpressionParserTest.cs @@ -35,6 +35,8 @@ using NUnit.Framework; using Microsoft.Build.Execution; using Microsoft.Build.Exceptions; using System.Collections.Generic; +using Microsoft.Build.Framework; +using Microsoft.Build.Logging; namespace MonoTests.Microsoft.Build.Internal { @@ -282,6 +284,31 @@ namespace MonoTests.Microsoft.Build.Internal var root = ProjectRootElement.Create (reader); new Project (root); } + + [Test] + public void MetadataExpansion () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <PropertyGroup> + <X>a/b/c.txt</X> + </PropertyGroup> + <Target Name='Foo'> + <CreateItem Include='$(X)'> + <Output TaskParameter='Include' ItemName='I' /> + </CreateItem> + <CreateProperty Value=""@(I->'%(Filename)%(Extension)')""> + <Output TaskParameter='Value' PropertyName='P' /> + </CreateProperty> + <Error Text=""Expected 'c.txt' but got '$(P)'"" Condition=""'$(P)'!='c.txt'"" /> + </Target> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + var p = new ProjectInstance (root); + var sw = new StringWriter (); + var result = p.Build (new ILogger [] { new ConsoleLogger (LoggerVerbosity.Minimal, sw.WriteLine, null, null)}); + Assert.IsTrue (result, "#1: " + sw); + } } } |