Add tests for dir.go