bee-san / pyWhat

🐸 Identify anything. pyWhat easily lets you identify emails, IP addresses, and more. Feed it a .pcap file or some text and it'll tell you what it is! 🧙‍♀️
MIT License
6.64k stars 357 forks source link

Make a test that tests whether the names of Regex are capitalised #205

Closed bee-san closed 3 years ago

bee-san commented 3 years ago

When someone submits a regex with:

"name": "all lowercase regex"

The test should fail and instead should ask for:

"name": "All Lowercase Regex"

See: https://www.geeksforgeeks.org/title-in-python/

Original mention of issue

As you are already enforcing the leading ^ and ending $ in regex and testing it. This could also be integrated as a test. (Like name.split(" "), iterate and maybe ignore single letter words)

Yes, we should have good regex.json tests.

_Originally posted by @piatrashkakanstantinass in https://github.com/bee-san/pyWhat/pull/204#discussion_r726145115_

PabloLec commented 3 years ago

The thing with .title() is that it will break words like SSH or URL. I can work on a text if you want to :wink:

bee-san commented 3 years ago

The thing with .title() is that it will break words like SSH or URL. I can work on a text if you want to 😉

Sure! :)