selftest: Add tests for expected behaviour on directories as well as files