Add test for generate