Skip to content

test: add regression tests for frame size getters#638

Open
majiayu000 wants to merge 1 commit intocharmbracelet:mainfrom
majiayu000:test/issue-353-frame-size-getters
Open

test: add regression tests for frame size getters#638
majiayu000 wants to merge 1 commit intocharmbracelet:mainfrom
majiayu000:test/issue-353-frame-size-getters

Conversation

@majiayu000
Copy link
Copy Markdown

Fixes #353

The frame size getters (GetHorizontalFrameSize, GetVerticalFrameSize,
GetFrameSize) had a bug where they only returned padding, ignoring border
widths. That was fixed in #411, but there were no dedicated tests for it.

This adds table-driven tests covering:

  • no style (returns 0)
  • padding only
  • border only (normal, thick, double, rounded, hidden)
  • border + padding combined
  • margin only
  • margin + padding + border (full frame)
  • partial borders (left+right only, top+bottom only)
  • asymmetric padding and margin

Cover GetHorizontalFrameSize, GetVerticalFrameSize, and GetFrameSize
with table-driven sub-tests: no style, padding only, various border
types, border+padding, margin, combined, partial borders, and
asymmetric values.

Ref charmbracelet#353

Signed-off-by: majiayu000 <1835304752@qq.com>
@majiayu000 majiayu000 marked this pull request as ready for review March 28, 2026 03:42
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.

add tests for GetHorizontalFrameSize

1 participant