I'm using goldenVsString to check that I correctly encode something to a binary output format (protobuf, but CBOR or anything non-textual would demonstrate this same problem). When the output doesn't match, tasty-golden throws an exception. This happens because unpackUtf8 calls one of the decodeUtf8 functions from text. The result of this is that I can use tasty-golden, but it crashes whenever the output changes, and then I run it with the --accept flag and everything works after that.
I'd like to modify the behavior so that if either the expected output or the actual output are not UTF-8 encoded text, then the "Test output was different from A, It was B" message is suppressed. It could just say "Test output was different. Not attempting to show non-textual content."
I can implement this if the maintainers find it agreeable.
I'm using
goldenVsString
to check that I correctly encode something to a binary output format (protobuf, but CBOR or anything non-textual would demonstrate this same problem). When the output doesn't match,tasty-golden
throws an exception. This happens becauseunpackUtf8
calls one of thedecodeUtf8
functions fromtext
. The result of this is that I can use tasty-golden, but it crashes whenever the output changes, and then I run it with the--accept
flag and everything works after that.I'd like to modify the behavior so that if either the expected output or the actual output are not UTF-8 encoded text, then the "Test output was different from A, It was B" message is suppressed. It could just say "Test output was different. Not attempting to show non-textual content."
I can implement this if the maintainers find it agreeable.