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

prevent IndexError on weird input. #69

Closed
wants to merge 1 commit into from
Closed

prevent IndexError on weird input. #69

wants to merge 1 commit into from

Conversation

uriva
Copy link

@uriva uriva commented Nov 21, 2018

No description provided.

@uriva uriva mentioned this pull request Nov 21, 2018
@coveralls
Copy link

Pull Request Test Coverage Report for Build 108

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 98.964%

Totals Coverage Status
Change from base Build 107: -0.2%
Covered Lines: 1146
Relevant Lines: 1158

💛 - Coveralls

1 similar comment
@coveralls
Copy link

coveralls commented Nov 21, 2018

Pull Request Test Coverage Report for Build 108

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 98.964%

Totals Coverage Status
Change from base Build 107: -0.2%
Covered Lines: 1146
Relevant Lines: 1158

💛 - Coveralls

@hugovk
Copy link
Contributor

hugovk commented Nov 21, 2018

Please can you include a unit test which fails before and passes after?

result[index] = result[index].upper()
return " ".join(result)
# Might occur on weird inputs, e.g. "lens with a lens ()."
except IndexError:
Copy link
Owner

Choose a reason for hiding this comment

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

This exception trap feels perhaps too broad. I'd rather the trap happen narrowly around a line or two. Or maybe there should be a test for orig vs. inflected to detect when split(" ") will not produce compatible arrays. Or even better would be to determine why postprocess would be called with incompatible parameters and disallow that.

@jaraco jaraco closed this Apr 19, 2019
@uriva uriva deleted the patch-1 branch April 22, 2019 15:01
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.

None yet

4 participants