add tests for generate