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

Disallow normalization and improve robustness against invalid input #80

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

srishanbhattarai
Copy link
Owner

@srishanbhattarai srishanbhattarai commented Apr 6, 2022

Changes

  • Reject B.S. dates (via the Date() function) that would have normalized. (fixes Month max day not validated #79)
  • Add upper bound checks for date limits, don't know why this wasn't
    there already
  • Go' iota based enums are very loosely typed so a nepcal.Month value of
    64 was possible since they are just ints. Added a check for this.

Notes

There is more to #79 than may initially seem. (Read #81)

- Reject B.S. dates (via the Date() function) that would have normalized.
- Add upper bound checks for date limits, don't know why this wasn't
  there already
- Go' iota based enums are very loosely typed so a nepcal.Month value of
  64 was possible since they are just ints. Added a check for this.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 304

  • 23 of 31 (74.19%) changed or added relevant lines in 3 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.7%) to 78.409%

Changes Missing Coverage Covered Lines Changed/Added Lines %
nepcal/util.go 12 14 85.71%
cmd/nepcal/cli.go 0 6 0.0%
Files with Coverage Reduction New Missed Lines %
nepcal/nepcal.go 2 75.27%
Totals Coverage Status
Change from base Build 302: -0.7%
Covered Lines: 345
Relevant Lines: 440

💛 - Coveralls

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.

Month max day not validated
2 participants