Add tests for error handling in cmdline_generator