Skip to content

Conversation

@ANAMASGARD
Copy link
Contributor

FIXES #180

Current Status

Tests failing (6/22) - this commit demonstrates the bug exists.

Problem Identified

pt.to.lines() returns constant 0.25 for all inputs instead of converting the actual value.

Current behavior:

  • grid::unit(2, "lines") returns 0.25 (expected: 2)
  • grid::unit(1, "cm") returns 0.25 (expected: ~2.86)
  • grid::unit(0, "lines") returns 0.25 (expected: 0)

Test Output

Screenshot From 2025-12-23 09-58-26

Tests demonstrate:
- pt.to.lines() returns 0.25 for all inputs (should vary)
- Zero values incorrectly return 0.25 instead of 0
- Positive values (2 lines, 1 cm) return 0.25 instead of correct conversion .
Issue #180 asked for test coverage of positive panel.margin values.
Added tests for lines, cm, and pt units. All tests pass - the
feature already works, just needed proper test coverage.

Fixes #180
@ANAMASGARD
Copy link
Contributor Author

What I Did

Added comprehensive test coverage for panel.margin with positive values (issue #180).

I added tests for:

  • Positive values in lines: grid::unit(2, "lines")
  • Positive values in cm: grid::unit(1, "cm")
  • Positive values in pt: grid::unit(12, "pt")
  • Comparison between zero and positive values

Test Results

  • All 22 tests pass
Screenshot From 2025-12-23 12-26-13

@codecov
Copy link

codecov bot commented Dec 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.46%. Comparing base (68b074e) to head (e122d8d).

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #286       +/-   ##
===========================================
+ Coverage   73.06%   95.46%   +22.39%     
===========================================
  Files         164        1      -163     
  Lines        8758     2754     -6004     
  Branches        0      554      +554     
===========================================
- Hits         6399     2629     -3770     
+ Misses       2359      125     -2234     
Flag Coverage Δ
javascript 95.46% <ø> (+14.70%) ⬆️
r ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ANAMASGARD
Copy link
Contributor Author

Sir @tdhock The R_coverage check is failing on an unrelated test
(test-compiler-ghpages.R:63) that expects 1 TSV file but finds 2.

This appears unrelated to panel.margin since my PR only adds test coverage
and doesn't modify any compilation or TSV generation code.

Sir can you please review the PR and guide me on what should I be doing next .

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.

theme(panel.margin=grid::unit(positive_number, "lines")) should work

2 participants