Closed codecop closed 2 years ago
Yes, you're right; Smoke assumes that the file is text and writes with the system line endings. I think it would be great to support a "binary" mode, where files are read and written in binary mode, and error output is shown using hex, not writing a nonsensical diff.
However, diffing a binary is kind of beyond me right now; I don't have the time to look into it.
As a workaround, you could consider using output filters to pipe the file through something like hexdump
(looks like this is available as part of the Cygwin util-linux package); this would effectively convert it to ASCII so diffs and the --bless
flag will work correctly. You can see an example of filters in https://github.com/SamirTalwar/smoke/blob/v2.3.0/fixtures/processing-filters/smoke.yaml.
Thank you. So it is known. All good then.
Known, but not solved. If you would like this feature, please re-open the issue and I'll try and make time in the next month or so. If you like, we can pair on it. 😃
Thank you for offering it. Not at the moment...
Hi Samir, hope you are doing well. I am using latest Smoke to test some command line tools. Some tools create binary output, e.g. BMP images. In these situations,
the xcolor.bmp had 0d added before all 0a bytes. I am using Windows. I guess it is something of the fwrite/C function or mode of file you use. Or maybe we need a switch to indicate binary files?