Skip to content

test: add comprehensive tests for GetHorizontalFrameSize, GetVerticalFrameSize, GetFrameSize#673

Open
XelHaku wants to merge 1 commit into
charmbracelet:mainfrom
TrebuchetDynamics:feat/frame-size-tests
Open

test: add comprehensive tests for GetHorizontalFrameSize, GetVerticalFrameSize, GetFrameSize#673
XelHaku wants to merge 1 commit into
charmbracelet:mainfrom
TrebuchetDynamics:feat/frame-size-tests

Conversation

@XelHaku

@XelHaku XelHaku commented May 11, 2026

Copy link
Copy Markdown

Summary

Adds dedicated tests for GetHorizontalFrameSize, GetVerticalFrameSize, and GetFrameSize with comprehensive coverage across border types, padding, margins, and their combinations.

Motivation

The underlying bug in GetHorizontalFrameSize was fixed in #411, but the tests added there were lost during a revert (see #353). This adds them back with expanded coverage.

Test coverage

  • Default (zero) state — no style set returns 0
  • Padding only — asymmetric padding values
  • Margins only — asymmetric margin values
  • Border types — Normal, Rounded, Double, Thick, Hidden
  • Combinations — border + padding, border + padding + margins
  • Partial borders — single-sided borders, all sides unset
  • GetFrameSize — verifies both return values simultaneously

All 23 test cases verify the frame size breakdown: frame = border + padding + margins.
No existing tests were modified.

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