-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Builtin: Add case-insensitivity support to comparison keywords #2439
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
Comments
Yes, this would be nice. If someone is interested to implement this, I'm willing to review PRs. This shouldn't cause backwards compatibility issues so the enhancement can be included to any release. The first step would be listing affected keywords in BuiltIn, String, and possibly in other libraries. Few things to take into account:
|
Doesn't look like it would be too difficult to implement this, although it could be a death by 1000 cuts if implemented everywhere that a string "could" be used. |
I agree adding this functionality to each and every keyword possibly operating with strings can be too big a task. Better to add this to the most important keywords only and then add it to new keywords later if needed. That said, I think there are quite many important keywords that ought to get this functionality from the beginning:
These would be nice too:
Also the "Not" versions of the above keywords (e.g. "Should Not Be Equal") should probably support this. Any other keyword people think are important? Although I'd like to see all these added together in one release, I'd prefer them to be implemented as separate PRs. That would split the implementation workload and also make reviewing easier. Probably it would be best to have a PR for each keyword and its "Not" version. |
Glad to see we're on the same page. That was the same list of keywords that I came up with during my research, and it was short enough to not seem overly daunting. |
Awesome! Please submit a PR with only one or two kws first. If there are things to fix, you can then avoid those issues in latter PRs. |
I'm having some troubles with the pull request for the first two keywords. Getting "403 Permission Denied" messages when doing the push, or trying to. |
Did you look at CONTRIBUTING.rst? In addition to project specific stuff, it has links to GitHub docs about PRs etc. The highlevel workflow is like this:
|
Thanks for pointing me in the right direction :-) Working with GitHub projects is a bit different than I'm used to. |
Yeah, GitHub and Git have their learning curves (I'm definitely not a master myself!) but they are so ubiquitous that learning them helps also with other projects. The PR #2447 seems to be setup just fine and also looks pretty good. There were some smallish things I hope you could fix, though, and I added comments to the PR itself. Thanks for your work so far and let me know there or here if you have any questions about the comments! |
Not sure if you saw my latest PR for this. Includes the rest of the keywords and acceptance test cases. Didn't want to ping you via message in case you were already alerted when PR's are submitted. |
Hi, I saw updates but been busy with a training trip. I ought to have time to concentrate on RF 3.0.1 more next week. Why did you close PR #2447? Are you planning to create a new one? |
Having all changes in one PR (#2450) turned out to be a bad idea, but @chriscallan has now opened #2461 about Currently the failure you get when you use
is The main problem with showing the normalized versions is that when using if is_truthy(case_insensitive) and is_string(item):
item = item.lower()
if is_string(container):
container = container.lower()
if is_list_like(container):
# this loses information by turning tuples, dicts, sets, etc. into lists
container = [c.lower() for c in container] If we want to show the normalized versions in this case, we needed to inspect the container type and try to preserve it along with possible additional data like dictionary values. It would be easier to just show the original values in the failure message in this case. I think all keywords should work same way, and thus also others should show the originals and not the normalized versions. What do others think about this? I think implementation wouldn't be too complicated and could be done in the helper method creating the failure message. |
Decided not to add this support to |
All the keywords listed in the original description now have got |
Enhancing error reporting is #2512. This issue can be considered done. |
For reference see topic on google group.
Update by @pekkaklarck:
These keywords should get the new
ignore_case
argument:Should Contain Any
andShould Not Contain Any
keywords #2120)The text was updated successfully, but these errors were encountered: