def create_test_case(type, trait, super_traits, number_of_errors):
    string = [ENUM_STRING, ENUM_STRUCT_VARIANT_STRING, STRUCT_STRING, STRUCT_TUPLE_STRING][type]
    all_traits = ','.join(([trait] + super_traits))
    super_traits = ','.join(super_traits)
    error_deriving = (('#[derive(%s)]' % super_traits) if super_traits else '')
    errors = '\n'.join((('//~%s ERROR' % ('^' * n)) for n in range(error_count)))
    code = string.format(traits=all_traits, errors=errors)
    return TEMPLATE.format(year=YEAR, error_deriving=error_deriving, code=code)
def create_test_case(type, trait, super_traits, number_of_errors):
    string = [ENUM_STRING, ENUM_STRUCT_VARIANT_STRING, STRUCT_STRING, STRUCT_TUPLE_STRING][type]
    all_traits = ','.join(([trait] + super_traits))
    super_traits = ','.join(super_traits)
    error_deriving = (('#[derive(%s)]' % super_traits) if super_traits else )
    errors = '\n'.join((('//~%s ERROR' % ('^' * n)) for n in range(error_count)))
    code = string.format(traits=all_traits, errors=errors)
    return TEMPLATE.format(year=YEAR, error_deriving=error_deriving, code=code)