Skip to content

Commit

Permalink
fixed fails in AppVeyor
Browse files Browse the repository at this point in the history
  • Loading branch information
nils-a committed Jul 2, 2020
1 parent a795439 commit 713b1b6
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Cake.7zip.Tests/Fixtures/Outputs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ 0 20 201 SHA1
0 32 A SHA256
0 8 4 CRC64
0 32 202 BLAKE2sp";
return demoOutput.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
return demoOutput.ToArrayOfLines();
}
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/Cake.7zip.Tests/Parsers/InformationOutputParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ 0 D 40302 Rar2
0 D 40303 Rar3
0 D 40305 Rar5
0 ED 6F10701 7zAES
0 ED 6F00181 AES256CBC".Split(new[] { Environment.NewLine }, StringSplitOptions.None);
0 ED 6F00181 AES256CBC".ToArrayOfLines();

Assert.Equal(expected.Length, actual.Count);
foreach (var codec in expected)
Expand Down Expand Up @@ -93,8 +93,7 @@ public void InformationParser_parses_Hashers()
0 20 201 SHA1
0 32 A SHA256
0 8 4 CRC64
0 32 202 BLAKE2sp".Split(new[] { Environment.NewLine }, StringSplitOptions.None);

0 32 202 BLAKE2sp".ToArrayOfLines();
Assert.Equal(expected.Length, actual.Count);
foreach (var hasher in expected)
{
Expand Down Expand Up @@ -163,7 +162,7 @@ 0 F Rar5 rar r00 R a r ! 1A 07 01 00
0 O Udf udf iso img offset=32768 01 C D 0 0 1
0 C SN LH wim wim swm esd ppkg M S W I M 00 00 00
0 C FMG zip zip z01 zipx jar xpi odt ods docx xlsx epub ipa apk appx P K 03 04 || P K 05 06 || P K 06 06 || P K 07 08 P K || P K 0 0 P K"
.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
.ToArrayOfLines();

Assert.Equal(expected.Length, actual.Count);
foreach (var format in expected)
Expand Down
13 changes: 13 additions & 0 deletions src/Cake.7zip.Tests/TestExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Cake.SevenZip.Tests
{
using System;
using System.Linq;

internal static class TestExtensions
{
internal static string[] ToArrayOfLines(this string @this)
{
return @this.Split(new[] { "\n" }, StringSplitOptions.None).Select(x => x.TrimEnd('\r')).ToArray();
}
}
}
10 changes: 8 additions & 2 deletions src/Cake.7zip/Builder/ISupportOutputBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,16 @@ public abstract class BaseOutputBuilder<TBuilder, TCommand, TOutput> : ISupportO
where TCommand : OutputCommand<TOutput>
{
/// <inheritdoc/>
public Action<TOutput> OutputAction { set { OutputCommand.OutputAction = value; } }
public Action<TOutput> OutputAction
{
set { OutputCommand.OutputAction = value; }
}

/// <inheritdoc/>
public Action<string[]> RawOutputAction { set { OutputCommand.RawOutputAction = value; } }
public Action<string[]> RawOutputAction
{
set { OutputCommand.RawOutputAction = value; }
}

/// <summary>
/// Gets the output command.
Expand Down
4 changes: 2 additions & 2 deletions src/Cake.7zip/Parsers/IInformationOutput.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace Cake.SevenZip
namespace Cake.SevenZip
{
using System.Collections.Generic;

/// <summary>
/// The parsed Output of the <see cref="InformationCommand"/>
/// The parsed Output of the <see cref="InformationCommand"/>.
/// </summary>
public interface IInformationOutput
{
Expand Down
2 changes: 0 additions & 2 deletions src/Cake.7zip/SevenZipRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public sealed class SevenZipRunner : Tool<SevenZipSettings>
private readonly ICakeEnvironment cakeEnvironment;
private readonly IRegistry registry;
private readonly IFileSystem fileSystem;
private readonly IProcessRunner processRunner;

/// <summary>
/// Initializes a new instance of the <see cref="SevenZipRunner"/> class.
Expand All @@ -43,7 +42,6 @@ public SevenZipRunner(
cakeEnvironment = environment;
this.registry = registry;
this.fileSystem = fileSystem;
this.processRunner = processRunner;
}

/// <summary>
Expand Down

0 comments on commit 713b1b6

Please sign in to comment.