nepcal
nepcal copied to clipboard
Disallow normalization and improve robustness against invalid input
Changes
- Reject B.S. dates (via the Date() function) that would have normalized. (fixes #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)
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% |
<!-- | Total: | 23 | 31 |
Files with Coverage Reduction | New Missed Lines | % |
---|---|---|
nepcal/nepcal.go | 2 | 75.27% |
<!-- | Total: | 2 |
Totals | |
---|---|
Change from base Build 302: | -0.7% |
Covered Lines: | 345 |
Relevant Lines: | 440 |