Commit graph

2 commits

Author SHA1 Message Date
889e78da90 feat(quando-r1o): consolidate benchmarks and achieve 99.5% test coverage
Reorganized test suite with consolidated benchmarks and comprehensive
edge case coverage, exceeding 95% minimum coverage requirement.

Changes:
- Created benchmark_test.go with all 52 benchmarks organized by category
  (arithmetic, clock, date, diff, format, inspection, parse, snap, unit)
- Removed benchmarks from 9 individual test files for better organization
- Added 6 edge case tests to improve coverage:
  * Format() unknown type fallback
  * formatLong() empty lang default
  * Format.String() unknown value
  * isYearPrefix() edge cases
  * StartOf()/EndOf() unsupported units
- Added 3 DST transition tests:
  * Spring forward (23-hour day)
  * Fall back (25-hour day)
  * Multiple timezone preservation

Results:
- Test coverage: 97.7% → 99.5% (exceeds 95% target)
- All 52 benchmarks consolidated and verified
- All benchmarks meet performance targets
- No test regressions

Files modified:
- Created: benchmark_test.go (580 lines)
- Modified: 9 test files (removed benchmarks, added tests)
2026-02-11 21:13:09 +01:00
a1d87c40c0 feat(quando-5ib): implement date inspection methods
Implement comprehensive date inspection API for querying metadata:

Individual methods:
- WeekNumber() - ISO 8601 week numbers (1-53)
- Quarter() - Fiscal quarters (1-4)
- DayOfYear() - Julian day (1-366)
- IsWeekend() - Weekend detection (Sat/Sun)
- IsLeapYear() - Leap year detection (4/100/400 rule)

Aggregated method:
- Info() - Returns DateInfo struct with all metadata + Unix timestamp

Implementation details:
- Delegates to stdlib: WeekNumber uses time.ISOWeek(), DayOfYear uses time.YearDay()
- Zero allocations for all operations
- Performance: All methods < 60ns (far exceeds <1µs target)
- ISO 8601 compliant week numbers (Week 1 contains Thursday)
- Handles edge cases: year boundaries, week 53, century leap years

Testing:
- 83 comprehensive test cases covering all methods
- Edge cases: year boundaries, week 53, leap years, century rules
- 6 benchmarks (all <1µs, zero allocations)
- 8 example tests with clear documentation
- Coverage: 97.7%

Files:
- inspect.go: 145 lines (6 methods + DateInfo struct)
- inspect_test.go: 464 lines (tests + benchmarks)
- example_test.go: +124 lines (8 examples)
2026-02-11 20:45:53 +01:00