Skip to content

Fix bugs and increase test coverage to 91%#6

Merged
tirthpatell merged 4 commits intomainfrom
improve/test-coverage-and-fixes
Mar 15, 2026
Merged

Fix bugs and increase test coverage to 91%#6
tirthpatell merged 4 commits intomainfrom
improve/test-coverage-and-fixes

Conversation

@tirthpatell
Copy link
Owner

Summary

  • Fix: Editor cursor scroll on line wrap — Left/Right arrow keys now call scrollToCursor() when wrapping across lines, preventing the cursor from going off-screen
  • Fix: Unicode search backspace — Viewer search input backspace now uses rune-based truncation instead of byte-based, fixing corruption of multi-byte Unicode characters
  • Remove dead code — Removed unreachable len(lines) == 0 check in NewBuffer (strings.Split always returns ≥1 element)
  • Increase test coverage from 74.2% to 91.3% — Added 41 new tests covering edge cases, boundary conditions, and previously untested code paths

Coverage

Package Before After
internal/editor 67.0% 95.4%
internal/viewer 76.6% 95.4%
internal/markdown 83.3% 91.7%
internal/linter 97.0% 98.0%
internal/stats 96.8% 96.8%
Total 74.2% 91.3%

Test plan

  • All 90 tests pass with -race flag
  • go fmt ./... clean
  • go vet ./... clean
  • Coverage verified via go tool cover -func

Tirth Patel and others added 4 commits February 19, 2026 23:48
…se test coverage

Fix editor Left/Right arrow keys not calling scrollToCursor() when
wrapping across lines, causing the cursor to go off-screen. Fix viewer
search backspace corrupting multi-byte Unicode characters by using
rune-based truncation. Remove dead code in NewBuffer.

Add 41 new tests covering edge cases, boundary conditions, and
previously untested code paths. Coverage: 74.2% -> 91.3%.
@tirthpatell tirthpatell merged commit b1d9066 into main Mar 15, 2026
6 checks passed
@tirthpatell tirthpatell deleted the improve/test-coverage-and-fixes branch March 15, 2026 06:24
Repository owner deleted a comment from codecov-commenter Mar 15, 2026
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