Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small improvement for snake case handling #179

Merged
merged 2 commits into from
Jul 17, 2022

Conversation

IljaKosynkin
Copy link
Contributor

Good time of the day!

I created a small improvement to the way snake case is handled. Right now if you have (for instance) "Icon=WIFI 24" it will be translated into "icon_w_i_f_i_24". With this update it will be "icon_wifi_24", which, I think, is better.

I'm not sure about tests though, haven't found any for this function. Any pointers?

@subdan
Copy link
Collaborator

subdan commented Jul 11, 2022

Thanks for the PR, @IljaKosynkin! I've added tests for StringCase. Please add a test for your case.

func testSnakeCase() throws {
...
    XCTAssertEqual("Icon=WIFI 24".snakeCased(), "icon_wifi_24")
...
}

@subdan
Copy link
Collaborator

subdan commented Jul 16, 2022

When you add test I can merge your PR.

@IljaKosynkin
Copy link
Contributor Author

Sorry, @subdan got caught up in work. Added tests

@subdan subdan merged commit 116629e into RedMadRobot:master Jul 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants