-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add --verbose option in both verbs and allow *.xyz in zip (#7)
* Add `--verbose | -v` option to both verbs, which shows the file paths being processed. * Allow `*.xyz` extension format in `dotnet-combine zip`.
- Loading branch information
1 parent
7304bac
commit 4614077
Showing
7 changed files
with
102 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
tests/DotnetCombine.Test/CompressorTests/ExtensionsTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using DotnetCombine.Options; | ||
using DotnetCombine.Services; | ||
using System.IO; | ||
using System.IO.Compression; | ||
using Xunit; | ||
|
||
namespace DotnetCombine.Test.CompressorTests | ||
{ | ||
public class ExtensionsTests : BaseCompressorTests | ||
{ | ||
[Theory] | ||
[InlineData("cs")] | ||
[InlineData(".cs")] | ||
[InlineData("*.cs")] | ||
public void SupportedExtensionFormats(string extension) | ||
{ | ||
var outputPath = Path.Combine(DefaultOutputDir, nameof(SupportedExtensionFormats) + Compressor.OutputExtension); | ||
|
||
// Act | ||
var options = new ZipOptions() | ||
{ | ||
Output = outputPath, | ||
OverWrite = true, | ||
Input = InputDir, | ||
Extensions = new[] { extension } | ||
}; | ||
|
||
var exitCode = new Compressor(options).Run(); | ||
|
||
// Assert | ||
Assert.Equal(0, exitCode); | ||
Assert.True(File.Exists(outputPath)); | ||
|
||
using var fs = new FileStream(outputPath, FileMode.Open); | ||
using ZipArchive zip = new ZipArchive(fs, ZipArchiveMode.Read); | ||
|
||
Assert.Equal(TotalCsFiles, zip.Entries.Count); | ||
} | ||
} | ||
} |