You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Builtin: Add case-insensitivity support to comparison keywords #2439
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:
I'd prefer acceptance tests over unit tests
Need to decide what is the name of the new option. ignore_case is my current favorite, but could also consider e.g. case_insensitive (longer) and caseless (shorter but not real word).
What to do if value is not a string? I think it would be best to leave the value as-is.
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.
It would seem that adding a case insensitivity option to generic methods like "Should Be Equal" may be a bit error prone with the assumptions about the values sent in. I think that adding the case sensitivity option to only "Should Be Equal As Strings" is a more logical, and limited, way to implement this functionality while limiting the assumptions about values being passed in.
Besides, hasn't the consumer of this keyword already declared that they want to compare as strings by indicating they want to do a case-insensitive comparison? :-)
I'd be happy to take this on, preferably the more limited approach I've suggested.
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:
Should Be Equal (this is the most common comparison keyword and most often used with strings)
Should Be Equal As Strings
Should Contain
Should Match
Should Match Regexp (should probably compile the pattern with re.IGNORECASE option in this case)
These would be nice too:
Should Start With
Should End With
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.
I'll get started on this today and should have something for you to review in the very near future.
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.
I haven't done any Pull Requests through github before, so not sure if there are any permissions that need to be set or if I'm just doing something wrong :-)
Any ideas on what the issue might be here?
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:
Create your own fork and clone it locally.
Make a topic branch for these changes. Commit changes to the branch and push them to GitHub.
Thanks for pointing me in the right direction :-) Working with GitHub projects is a bit different than I'm used to.
I think I've got the pull request setup properly and that I've got the acceptance test cases worked out.
Just the "Should Be Equal", "Should Be Equal As Strings" keywords.
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?
I had closed PR #2447 and opened another because it seemed easier to close that one down, make the additional changes and start a fresh PR. I opened #2450 with the entire set of changes.
changed the title [-]String and Builtin libraries: Enhance string comparison keywords by adding ignore case option[/-][+]Builtin: Add case-insensitivity support to comparison keywords[/+]on Dec 30, 2016
Decided not to add this support to Should (Not) Match Regexp. They already support embedding case-insensitivity flag into the pattern. If we add explicit case-insensitivity support, should consider adding support also for other regexp flags.
All the keywords listed in the original description now have got ignore_case=False option. I'm not entirely happy about error reporting (see my comment above), but don't have time to enhance it now. I'll submit a separate issue about that for RF 3.1.
Activity
pekkaklarck commentedon Sep 2, 2016
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:
ignore_caseis my current favorite, but could also consider e.g.case_insensitive(longer) andcaseless(shorter but not real word).chriscallan commentedon Sep 16, 2016
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.
It would seem that adding a case insensitivity option to generic methods like "Should Be Equal" may be a bit error prone with the assumptions about the values sent in. I think that adding the case sensitivity option to only "Should Be Equal As Strings" is a more logical, and limited, way to implement this functionality while limiting the assumptions about values being passed in.
Besides, hasn't the consumer of this keyword already declared that they want to compare as strings by indicating they want to do a case-insensitive comparison? :-)
I'd be happy to take this on, preferably the more limited approach I've suggested.
pekkaklarck commentedon Sep 20, 2016
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:
re.IGNORECASEoption in this case)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.
chriscallan commentedon Sep 20, 2016
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.
I'll get started on this today and should have something for you to review in the very near future.
pekkaklarck commentedon Sep 20, 2016
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.
chriscallan commentedon Sep 20, 2016
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.
I haven't done any Pull Requests through github before, so not sure if there are any permissions that need to be set or if I'm just doing something wrong :-)
Any ideas on what the issue might be here?
pekkaklarck commentedon Sep 20, 2016
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:
chriscallan commentedon Sep 22, 2016
Thanks for pointing me in the right direction :-) Working with GitHub projects is a bit different than I'm used to.
I think I've got the pull request setup properly and that I've got the acceptance test cases worked out.
Just the "Should Be Equal", "Should Be Equal As Strings" keywords.
pekkaklarck commentedon Sep 22, 2016
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!
chriscallan commentedon Sep 27, 2016
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.
pekkaklarck commentedon Sep 30, 2016
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?
chriscallan commentedon Sep 30, 2016
I had closed PR #2447 and opened another because it seemed easier to close that one down, make the additional changes and start a fresh PR. I opened #2450 with the entire set of changes.
1 remaining item
Cleaning up case-insensitivity support of comparison kws.
[-]String and Builtin libraries: Enhance string comparison keywords by adding ignore case option[/-][+]Builtin: Add case-insensitivity support to comparison keywords[/+]Clean-up "Should (Not) End With" case-insensitivity
Should Contain X Times case-insensitivity #2439
pekkaklarck commentedon Dec 30, 2016
Decided not to add this support to
Should (Not) Match Regexp. They already support embedding case-insensitivity flag into the pattern. If we add explicit case-insensitivity support, should consider adding support also for other regexp flags.Should (Not) Contain Any case-insensitivity #2439
Should (Not) Match case-insensitivity #2439
pekkaklarck commentedon Dec 30, 2016
All the keywords listed in the original description now have got
ignore_case=Falseoption. I'm not entirely happy about error reporting (see my comment above), but don't have time to enhance it now. I'll submit a separate issue about that for RF 3.1.pekkaklarck commentedon Dec 30, 2016
Enhancing error reporting is #2512. This issue can be considered done.