Add code generation tests (fix #36)