Revert "Write test without chdir."

This reverts commit 165a8f316e0dabd8f52095dfb2ed8ab0c9d0704a.