Add tests for the generateFile function