tests: add tests for exists and directory