Skip to content

Add proper assertions to incomplete tests#6

Merged
arminsabouri merged 2 commits intopayjoin:masterfrom
0xZaddyy:add-missing-assertions
Mar 2, 2026
Merged

Add proper assertions to incomplete tests#6
arminsabouri merged 2 commits intopayjoin:masterfrom
0xZaddyy:add-missing-assertions

Conversation

@0xZaddyy
Copy link
Contributor

Several tests in the codebase had missing or inadequate assertions:

  • Some tests only created objects without verifying results
  • Others used println! for debugging instead of actual validation
  • A few contained TODO comments indicating incomplete verification

Previously, several tests had missing or inadequate assertions either using println for debugging instead of validation.
@arminsabouri arminsabouri self-requested a review February 27, 2026 16:19
Copy link
Collaborator

@arminsabouri arminsabouri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just had one comment. Otherwise looks great.

src/lib.rs Outdated
"Missed payment obligations percentage: {:?}",
result.precentage_of_payment_obligations_missed()

// Assert reasonable missed percentage (adjust threshold as needed)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assertion is just checking that we have a valid precentage. It should be determenistic.
Can we just check that this is 0.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when i tried to check i got a value from the first failed test instance.

@0xZaddyy 0xZaddyy requested a review from arminsabouri March 2, 2026 20:58
Copy link
Collaborator

@arminsabouri arminsabouri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack.
Please squash your commits in the future

@arminsabouri arminsabouri merged commit 06dfee9 into payjoin:master Mar 2, 2026
1 check passed
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.

2 participants