Add more unit tests for code generator.