I’m trying to write a doctest to show the usage of a particular function, however this function returns a tuple that has the contents of a File.read!
inside of it. This causes an issue as I cannot sanely add an example return value that will allow the test to pass.
Example, when run in iex
the result will be nicely truncated
iex> my_fun()
{:ok, <<1, 2, 3, ...>>
However in the doctest I can’t use the ...
truncation at the end of the binary and presumably would have to paste in the entire contents to make this pass (which would not please someone reading through docs )
I see that the docs for File.read!
also doesn’t have a usage example, which I would guess is because of this same reason.
Has anyone tackled this before? Or is this a limitation of ExUnit that people tend to work around?