tests for dot format, refactoring for better code reuse