I have a function that has a very long return value. I want to format it with line breaks, but this would cause the doctest to expect those line breaks in the function output.
Is there a way to format the expected return value that wouldn’t require me to change the function’s return value?
Here is an example of what I have:
iex> Softswitch.XML.Core.serialize(Softswitch.XML.Core.root(
...> Softswitch.XML.Core.section("dialplan",
...> Softswitch.XML.Core.condition("source", "mod_sofia"))))
'<?xml version="1.0" encoding="UTF-8" standalone="no"?><document type="freeswitch/xml"><section name="dialplan"><condition field="source" expression="mod_sofia"/></section></document>'
Here is what I want to do:
iex> Softswitch.XML.Core.serialize(Softswitch.XML.Core.root(
...> Softswitch.XML.Core.section("dialplan",
...> Softswitch.XML.Core.condition("source", "mod_sofia"))))
'<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="freeswitch/xml">
<section name="dialplan"><condition field="source" expression="mod_sofia"/></section>
</document>'