Skip to content

Commit

Permalink
respect encoding for empty file
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Dec 23, 2023
1 parent 144b24b commit 6273bb6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project>
<PropertyGroup>
<NoWarn>CS1591;CS0649;xUnit1026;xUnit1013;CS1573;VerifyTestsProjectDir;VerifySetParameters</NoWarn>
<Version>22.10.0</Version>
<Version>22.10.1</Version>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>preview</LangVersion>
<AssemblyVersion>1.0.0</AssemblyVersion>
Expand Down
18 changes: 18 additions & 0 deletions src/StaticSettingsTests/EncodingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@
public class EncodingTests :
BaseTest
{
// [Fact]
// public async Task UseUtf8NoBomNotAccepted()
// {
// VerifierSettings.UseUtf8NoBom();
//
// var file = CurrentFile.Relative($"EncodingTests.{nameof(UseUtf8NoBomNotAccepted)}.verified.txt");
// File.Delete(file);
// try
// {
// await Verify("value");
// }
// catch
// {
// }
//
// Assert.Equal(0, new FileInfo(file).Length);
// }

[Fact]
public async Task UseUtf8NoBom()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Verify/Verifier/VerifyEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ Task RunDiffAutoCheck(FilePair file)

if (diffEnabled)
{
return DiffRunner.LaunchAsync(file.ReceivedPath, file.VerifiedPath);
return DiffRunner.LaunchAsync(file.ReceivedPath, file.VerifiedPath, VerifierSettings.Encoding);
}
#endif

Expand Down

0 comments on commit 6273bb6

Please sign in to comment.