From 8a7d727f1ab0dfef956db726d64985311291505e Mon Sep 17 00:00:00 2001
From: Sean Hall <r.sean.hall@gmail.com>
Date: Fri, 8 Nov 2019 14:46:30 +1000
Subject: Add failing test for getting Shortcut/@Name from wixlib.

---
 .../MsiQueryFixture.cs                             |  3 ++-
 .../TestData/Shortcut/ShortcutProperty.wxs         |  2 +-
 .../WixlibQueryFixture.cs                          | 30 ++++++++++++++++++++++
 3 files changed, 33 insertions(+), 2 deletions(-)

(limited to 'src')

diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
index 3c20e997..2be582c9 100644
--- a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
+++ b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
@@ -672,10 +672,11 @@ namespace WixToolsetTest.CoreIntegration
                 result.AssertSuccess();
 
                 Assert.True(File.Exists(msiPath));
-                var results = Query.QueryDatabase(msiPath, new[] { "MsiShortcutProperty" });
+                var results = Query.QueryDatabase(msiPath, new[] { "MsiShortcutProperty", "Shortcut" });
                 Assert.Equal(new[]
                 {
                     "MsiShortcutProperty:scp4GOCIx4Eskci4nBG1MV_vSUOZt4\tTheShortcut\tCustomShortcutKey\tCustomShortcutValue",
+                    "Shortcut:TheShortcut\tINSTALLFOLDER\td|\tShortcutComp\t[#filcV1yrx0x8wJWj4qMzcH21jwkPko]\t\t\t\t\t\t\t\t\t\t\t",
                 }, results);
             }
         }
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/ShortcutProperty.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/ShortcutProperty.wxs
index d0a041b8..27f2ab9b 100644
--- a/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/ShortcutProperty.wxs
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Shortcut/ShortcutProperty.wxs
@@ -4,7 +4,7 @@
         <ComponentGroup Id="ProductComponents">
             <Component Id="ShortcutComp" Directory="INSTALLFOLDER" Guid="5B3B3FC1-533D-4C29-BFB3-0E88B51E59D8">
                 <File Source="test.txt">
-                    <Shortcut Id="TheShortcut" Name="TestShortcut" Directory="INSTALLFOLDER">
+                    <Shortcut Id="TheShortcut" Name="d" Directory="INSTALLFOLDER">
                         <ShortcutProperty Key="CustomShortcutKey" Value="CustomShortcutValue"></ShortcutProperty>
                     </Shortcut>
                 </File>
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs
index 7f9b9686..53bc5910 100644
--- a/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs
+++ b/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs
@@ -12,6 +12,36 @@ namespace WixToolsetTest.CoreIntegration
 
     public class WixlibQueryFixture
     {
+        [Fact(Skip = "Test demonstrates failure")]
+        public void ShortcutNameWithPreprocessorVariableIsResolved()
+        {
+            var folder = TestData.Get(@"TestData\Shortcut");
+
+            using (var fs = new DisposableFileSystem())
+            {
+                var baseFolder = fs.GetFolder();
+                var intermediateFolder = Path.Combine(baseFolder, "obj");
+                var wixlibPath = Path.Combine(intermediateFolder, @"test.wixlib");
+
+                var result = WixRunner.Execute(new[]
+                {
+                    "build",
+                    Path.Combine(folder, "ShortcutProperty.wxs"),
+                    "-intermediateFolder", intermediateFolder,
+                    "-o", wixlibPath
+                });
+
+                result.AssertSuccess();
+
+                var intermediate = Intermediate.Load(wixlibPath);
+                var allTuples = intermediate.Sections.SelectMany(s => s.Tuples);
+                var shortcutTuple = allTuples.OfType<ShortcutTuple>()
+                                             .SingleOrDefault();
+                Assert.NotNull(shortcutTuple);
+                Assert.Equal("d", shortcutTuple.Name);
+            }
+        }
+
         [Fact]
         public void UpgradeProducesReferenceToRemoveExistingProducts()
         {
-- 
cgit v1.2.3-55-g6feb