Add test for code generation