Skip to content

Is the behavior of macrocase right? #8

Description

@me-kell

macrocase("My URL") returns MY_UR_L (note the underscore between R and L). I would expect MY_URL

Regarding the word boundaries I would expect a result similar to cobolcase, snakecase, and kebabcase.

cobolcase("My URL") returns MY-URL

>>> from caseconverter import *
>>> cases = [str, macrocase, cobolcase, kebabcase, snakecase]
>>> for case in cases:
...     t = f"{case.__name__: <15}"
...     for s in ["My New URL", "My NewURL", "My URL", "My IP", "My MACRO"]:
...         t += f"{case(s): <15}"
...     print(t)

str            My New URL     My NewURL      My URL         My IP          My MACRO
macrocase      MY_NEW_UR_L    MY_NEW_U_R_L   MY_UR_L        MY_IP          MY_MA_C_R_O
cobolcase      MY-NEW-URL     MY-NEW-URL     MY-URL         MY-IP          MY-MACRO
kebabcase      my-new-url     my-new-url     my-url         my-ip          my-macro
snakecase      my_new_url     my_new_url     my_url         my_ip          my_macro

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions