recactor: test code into a shared example
janitorial: copy dist_dirs by value for maintainability
add test for dist_dirs missing