test: standardize test function names across codebase#731
test: standardize test function names across codebase#731Ifechukwudaniel wants to merge 42 commits into
Conversation
✅ Deploy Preview for contracts-stylus canceled.
|
|
@0xNeshi, can you please review this so I can do the next one |
|
Hey @Ifechukwudaniel , appreciate the enthusiasm! We're currently under a huge workload, and will review the PR as soon as it is reduced. Thanks! |
0xNeshi
left a comment
There was a problem hiding this comment.
Good job. Left some comments.
0xNeshi
left a comment
There was a problem hiding this comment.
Please resolve merge conflicts
| @@ -544,7 +548,7 @@ async fn error_invalid_array_length_in_batch_mint( | |||
| } | |||
There was a problem hiding this comment.
Change errors_when_invalid_receiver_contract_in_batch_mint to mint_batch_reverts_when_receiver_invalid
| @@ -544,7 +548,7 @@ async fn error_invalid_array_length_in_batch_mint( | |||
| } | |||
|
|
|||
There was a problem hiding this comment.
Change error_invalid_array_length_in_batch_mint to mint_batch_reverts_when_array_length_invalid
qalisander
left a comment
There was a problem hiding this comment.
Good work!
I see the second part of convention function_name_revert_when_condition is not applicable for crypto library. Namely revert_when syntax relates to smart contracts domain only.
|
|
||
| #[test] | ||
| fn add() { | ||
| fn add_succeeds_for_field_elements() { |
There was a problem hiding this comment.
These two test cases have an inconsistent description: "succeeds_for_field_elements" and "succeeds_with_expected_value" but test cases are quite similar.
@0xNeshi is "description" mandatory in our convention for successful tests? (function_name_description).
Can't we leave it as "" here??xD
There was a problem hiding this comment.
I'm ok with leaving just add for simple test cases OR ones that test the same function from multiple vectors
|
On it, i will complete it |
Co-authored-by: Nenad <nenad.misic@openzeppelin.com>
Co-authored-by: Nenad <nenad.misic@openzeppelin.com>
Co-authored-by: Nenad <nenad.misic@openzeppelin.com>
Co-authored-by: Nenad <nenad.misic@openzeppelin.com>
Co-authored-by: Nenad <nenad.misic@openzeppelin.com>
Co-authored-by: Nenad <nenad.misic@openzeppelin.com>
Co-authored-by: Nenad <nenad.misic@openzeppelin.com>
Co-authored-by: Nenad <nenad.misic@openzeppelin.com>
Co-authored-by: Nenad <nenad.misic@openzeppelin.com>
Co-authored-by: Nenad <nenad.misic@openzeppelin.com>
Co-authored-by: Nenad <nenad.misic@openzeppelin.com>
This PR standardizes test function names across the codebase to follow a consistent naming pattern:
function_name_descriptionfor successful casesfunction_name_revert_when_conditionfor expected revertsThis improves clarity, consistency and makes it easier to understand the purpose of each test at a glance.
Closes: 491
Checklist: