unit test: writer: Correct dir handling