Skip to content

fix: implement missing utilities and fix edge-case bugs - #263

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2422-1785001475
Open

fix: implement missing utilities and fix edge-case bugs#263
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2422-1785001475

Conversation

@stooit

@stooit stooit commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all 16 previously failing tests across the utility library. The full suite now passes (60 pass / 0 fail). No test files were modified and no dependencies were added.

Changes

File Fix
src/calculator.ts divide now throws on division by zero
src/string-utils.ts Implemented truncate (word-boundary, "..." counts toward maxLength, unchanged when str.length <= maxLength); fixed wordCount for consecutive spaces
src/task-manager.ts Added remove, update, and sortBy (priority high > medium > low; createdAt oldest-first)
src/date-utils.ts Fixed off-by-one in formatRelative at the hour/day boundary
src/validator.ts isEmail accepts long TLDs (e.g. user@example.museum); isUrl accepts ports (e.g. http://localhost:3000)

Stale // BUG: JSDoc comments describing the now-fixed defects were removed to avoid misleading future readers.

Testing

bun test → 60 pass, 0 fail, 70 expect() calls.

Assumptions

  • truncate behaviour for maxLength < 4 is not exercised by any test and was left as-is rather than over-engineering an uncovered edge case.
  • Fixes were scoped strictly to what the tests require; no unrelated refactoring.

Verification

  • Implementation delegated to the code agent, independently verified via bun test.
  • Diff reviewed by the review agent — no correctness blockers.

- calculator: guard divide against division by zero
- string-utils: implement truncate (word-boundary, ... counts toward maxLength); fix wordCount for consecutive spaces
- task-manager: add remove/update/sortBy (priority high>medium>low, createdAt oldest-first)
- date-utils: fix formatRelative off-by-one at hour/day boundaries
- validator: allow long TLDs in isEmail and ports in isUrl

All 60 tests pass; no test files or dependencies changed.
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.

1 participant