This, 100%. Unfortunately, private functions aren’t testable without jumping through some hoops. I found a macro on SO somewhere for defining functions that expands to
def if the environment is
defp otherwise. It’s a hack and I only use it in my own code, but I wish it were built in.
(And inb4 “private functions should be so simple they don’t require testing”. IMO it’s reasonable to have complex functions which nonetheless should not be part of the public interface.)