0

I'm trying out https://github.com/VerifyTests/Verify for unit testing. It outputs snapshots in UTF-8 but does not include the UTF-8 byte order mark at the beginning of the received file. This makes my diff tool think the file is using the system encoding which is incorrect, and causes some minor issues.

Is there any way of forcing the BOM in Verify?

I've tried both 13.0.3 and 11.27.0 of Verify with the same results. My test project uses .NET Framework 4.7.2.

I tried writing directly to files using new UTF8Encoding(true, true) and that outputs the BOM at the beginning of the files just fine. (I check the files with a hex editor)

This is just a minor nuisance though. I have to manually check the encoding in KDiff3 every time there's a difference.

  • The ````UTF8Encoding```` instance used by ````WriteText```` method in ````Verify/FileHelpers.cs```` is instantiated with ````encoderShouldEmitUTF8Identifier:=true````. Are you sure the received file has no BOM bytes? What .net version and Verify version are you using? – cly Oct 10 '21 at 14:32
  • What objects are you verifying? – cly Oct 10 '21 at 14:36

1 Answers1

0

this has been fixed. can you update to the newest version

Simon
  • 33,714
  • 21
  • 133
  • 202