Skip to content

feat: provide decimal number specific assertions has_scale_of, has_precision_of and is_integer#49

Merged
haraldmaida merged 2 commits into
mainfrom
feat/decimal-specific-assertions
Jun 7, 2025
Merged

feat: provide decimal number specific assertions has_scale_of, has_precision_of and is_integer#49
haraldmaida merged 2 commits into
mainfrom
feat/decimal-specific-assertions

Conversation

@haraldmaida
Copy link
Copy Markdown
Member

Decimal numbers have the specific properties scale and precision. It should be possible to assert those properties through explicitly provided assertion methods.

Added assertion methods has_scale_of, has_precision_of and is_integer for decimal numbers. They have been implemented for bigdecimal::BigDecimal and rust_decimal::Decimal.

These assertions are implemented for all types that implement the property trait DecimalProperties. This allows to implement those assertions for other decimal types by just implementing the trait DecimalProperties for those types.

@haraldmaida haraldmaida self-assigned this Jun 7, 2025
@haraldmaida haraldmaida added the enhancement New feature or request label Jun 7, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.69%. Comparing base (130cc5f) to head (6d14803).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #49      +/-   ##
==========================================
+ Coverage   96.62%   96.69%   +0.07%     
==========================================
  Files          30       30              
  Lines        3345     3416      +71     
  Branches     3345     3416      +71     
==========================================
+ Hits         3232     3303      +71     
  Misses        109      109              
  Partials        4        4              

☔ 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.

@haraldmaida haraldmaida merged commit 29f1efa into main Jun 7, 2025
18 checks passed
@haraldmaida haraldmaida deleted the feat/decimal-specific-assertions branch June 7, 2025 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant