Add tests for directory mode