by mcintyre1994 · 3y ago · 0 comments
You can write inline examples in your docstrings and they’re automatically turned into unit tests. So again you get that documentation as an executable test suite not subject to rot, but at a per-function level. Same kind of idea but different levels of the documentation stack.
- Elixir's scripting makes it super easy to write a one-liner that tests a function, that'd be a lot more verbose in many other languages
- You need the docs tool and unit tests tools to 'speak the same language' to make it work, and for whatever reason Elixir devs don't seem as intent on reinventing tools like those as some other languages