Skip to content

Comments

Add "letters" assertion for Unicode letters#112

Merged
BackEndTea merged 6 commits intowebmozarts:masterfrom
rossbearman:master
Aug 7, 2019
Merged

Add "letters" assertion for Unicode letters#112
BackEndTea merged 6 commits intowebmozarts:masterfrom
rossbearman:master

Conversation

@rossbearman
Copy link
Contributor

@rossbearman rossbearman commented Jun 25, 2019

This PR adds support for validating against the Unicode letter class.

Tests cover passing assertions for basic Latin characters and an array of different Unicode only alphabets and failing assertions for strings including numbers, the simple alphabet's copyright symbol and a Unicode emoji.

Fixes: #98

@BackEndTea BackEndTea self-assigned this Jun 25, 2019
@BackEndTea BackEndTea changed the title Add "letter" assertion for Unicode letters Add "letters" assertion for Unicode letters Jun 27, 2019
Copy link
Collaborator

@BackEndTea BackEndTea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍
Do you also want to take a look @Nyholm ?

Copy link
Contributor

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the implementation but I’m not 100% sure about the name “letters”. Could we get a more descriptive name? OnlyUnicode?

@rossbearman
Copy link
Contributor Author

I don't think onlyUnicode would be appropriate, as it's not all Unicode characters, it's only Unicode characters which are classified as letters. I went with letters() as it encompasses pretty much any letter you can represent on a computer, regardless of alphabet. unicodeLetters() is possibly the most clear?

@BackEndTea
Copy link
Collaborator

unicodeLetters Is clear to me, what do you think @Nyholm ?

@BackEndTea BackEndTea removed their assignment Jul 4, 2019
Copy link
Collaborator

@BackEndTea BackEndTea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍
Thank you for your contribution.

I'll merge this as soon as CI is finished

@BackEndTea BackEndTea merged commit 14b3911 into webmozarts:master Aug 7, 2019
BackEndTea pushed a commit that referenced this pull request Aug 9, 2019
* Add "unicodeLetters" assertion for Unicode letters
BackEndTea pushed a commit that referenced this pull request Aug 9, 2019
* Add "unicodeLetters" assertion for Unicode letters
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.

Assert::alpha() only works with Latin characters

3 participants