Add tests for file check.
Implement file check.