Skip to content

Commit

Permalink
Single-File Bundler: Add a FileSize test (#35149)
Browse files Browse the repository at this point in the history
Add a bundler consistency tests that verifies that the size of each embedded file
(recorded in the bundle manifest) matches its original size of the file on disk.
  • Loading branch information
swaroop-sridhar committed Apr 20, 2020
1 parent aee4d57 commit 779588a
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,17 @@ public void TestBundlingNativeBinaries(BundleOptions options)
bundler.BundleManifest.Contains($"{coreclr}").Should().Be(options.HasFlag(BundleOptions.BundleNativeBinaries));
}

[Fact]
public void TestFileSizes()
{
var fixture = sharedTestState.TestFixture.Copy();
var bundler = BundleHelper.Bundle(fixture);
var publishPath = BundleHelper.GetPublishPath(fixture);

bundler.BundleManifest.Files.ForEach(file =>
Assert.True(file.Size == new FileInfo(Path.Combine(publishPath, file.RelativePath)).Length));
}

[Fact]
public void TestAssemblyAlignment()
{
Expand Down

0 comments on commit 779588a

Please sign in to comment.