diff options
| author | Rob Mensching <rob@firegiant.com> | 2021-03-02 11:26:55 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2021-03-03 12:03:35 -0800 |
| commit | e362f93f9fa9ed4b174333d44fcda25790bc85e0 (patch) | |
| tree | eaedb4854b97b3333bbdb9102416a699a0175209 /src/test/WixToolsetTest.CoreIntegration/PatchFixture.cs | |
| parent | a13f13130b84845fed54f812e2ad33136c7649cb (diff) | |
| download | wix-e362f93f9fa9ed4b174333d44fcda25790bc85e0.tar.gz wix-e362f93f9fa9ed4b174333d44fcda25790bc85e0.tar.bz2 wix-e362f93f9fa9ed4b174333d44fcda25790bc85e0.zip | |
Add test to verify patches without files work
Resolves wixtoolset/issues#4912
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/PatchFixture.cs')
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/PatchFixture.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/PatchFixture.cs b/src/test/WixToolsetTest.CoreIntegration/PatchFixture.cs index dda4ca28..788cc01f 100644 --- a/src/test/WixToolsetTest.CoreIntegration/PatchFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/PatchFixture.cs | |||
| @@ -53,6 +53,38 @@ namespace WixToolsetTest.CoreIntegration | |||
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | [Fact] | 55 | [Fact] |
| 56 | public void CanBuildSimplePatchWithNoFileChanges() | ||
| 57 | { | ||
| 58 | var folder = TestData.Get(@"TestData\PatchNoFileChanges"); | ||
| 59 | |||
| 60 | using (var fs = new DisposableFileSystem()) | ||
| 61 | { | ||
| 62 | var tempFolder = fs.GetFolder(); | ||
| 63 | |||
| 64 | var baselinePdb = BuildMsi("Baseline.msi", folder, tempFolder, "1.0.0", "1.0.0", "1.0.0"); | ||
| 65 | var update1Pdb = BuildMsi("Update.msi", folder, tempFolder, "1.0.1", "1.0.1", "1.0.1"); | ||
| 66 | var patchPdb = BuildMsp("Patch1.msp", folder, tempFolder, "1.0.1", hasNoFiles: true); | ||
| 67 | var patchPath = Path.ChangeExtension(patchPdb, ".msp"); | ||
| 68 | |||
| 69 | Assert.True(File.Exists(baselinePdb)); | ||
| 70 | Assert.True(File.Exists(update1Pdb)); | ||
| 71 | |||
| 72 | var doc = GetExtractPatchXml(patchPath); | ||
| 73 | Assert.Equal("{7D326855-E790-4A94-8611-5351F8321FCA}", doc.Root.Element(PatchNamespace + "TargetProductCode").Value); | ||
| 74 | |||
| 75 | var names = Query.GetSubStorageNames(patchPath); | ||
| 76 | Assert.Equal(new[] { "#RTM.1", "RTM.1" }, names); | ||
| 77 | |||
| 78 | var cab = Path.Combine(tempFolder, "foo.cab"); | ||
| 79 | Query.ExtractStream(patchPath, "foo.cab", cab); | ||
| 80 | Assert.True(File.Exists(cab)); | ||
| 81 | |||
| 82 | var files = Query.GetCabinetFiles(cab); | ||
| 83 | Assert.Empty(files); | ||
| 84 | } | ||
| 85 | } | ||
| 86 | |||
| 87 | [Fact] | ||
| 56 | public void CanBuildBundleWithNonSpecificPatches() | 88 | public void CanBuildBundleWithNonSpecificPatches() |
| 57 | { | 89 | { |
| 58 | var folder = TestData.Get(@"TestData\PatchNonSpecific"); | 90 | var folder = TestData.Get(@"TestData\PatchNonSpecific"); |
