Skip to content

Commit

Permalink
remove tuple syntax from test
Browse files Browse the repository at this point in the history
  • Loading branch information
ggonzalez94 committed Nov 19, 2024
1 parent 1deb8e0 commit ab162d7
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 33 deletions.
20 changes: 10 additions & 10 deletions packages/access/src/tests/test_accesscontrol.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ fn test_assert_only_role() {
}

#[test]
#[should_panic(expected: ('Caller is missing role',))]
#[should_panic(expected: 'Caller is missing role')]
fn test_assert_only_role_unauthorized() {
let state = setup();
start_cheat_caller_address(test_address(), OTHER());
state.assert_only_role(ROLE);
}

#[test]
#[should_panic(expected: ('Caller is missing role',))]
#[should_panic(expected: 'Caller is missing role')]
fn test_assert_only_role_unauthorized_when_authorized_for_another_role() {
let mut state = setup();
state.grant_role(ROLE, AUTHORIZED());
Expand Down Expand Up @@ -151,15 +151,15 @@ fn test_grantRole_multiple_times_for_granted_role() {
}

#[test]
#[should_panic(expected: ('Caller is missing role',))]
#[should_panic(expected: 'Caller is missing role')]
fn test_grant_role_unauthorized() {
let mut state = setup();
start_cheat_caller_address(test_address(), AUTHORIZED());
state.grant_role(ROLE, AUTHORIZED());
}

#[test]
#[should_panic(expected: ('Caller is missing role',))]
#[should_panic(expected: 'Caller is missing role')]
fn test_grantRole_unauthorized() {
let mut state = setup();
start_cheat_caller_address(test_address(), AUTHORIZED());
Expand Down Expand Up @@ -245,15 +245,15 @@ fn test_revokeRole_multiple_times_for_granted_role() {
}

#[test]
#[should_panic(expected: ('Caller is missing role',))]
#[should_panic(expected: 'Caller is missing role')]
fn test_revoke_role_unauthorized() {
let mut state = setup();
start_cheat_caller_address(test_address(), OTHER());
state.revoke_role(ROLE, AUTHORIZED());
}

#[test]
#[should_panic(expected: ('Caller is missing role',))]
#[should_panic(expected: 'Caller is missing role')]
fn test_revokeRole_unauthorized() {
let mut state = setup();
start_cheat_caller_address(test_address(), OTHER());
Expand Down Expand Up @@ -345,7 +345,7 @@ fn test_renounceRole_multiple_times_for_granted_role() {
}

#[test]
#[should_panic(expected: ('Can only renounce role for self',))]
#[should_panic(expected: 'Can only renounce role for self')]
fn test_renounce_role_unauthorized() {
let mut state = setup();
let contract_address = test_address();
Expand All @@ -357,7 +357,7 @@ fn test_renounce_role_unauthorized() {
}

#[test]
#[should_panic(expected: ('Can only renounce role for self',))]
#[should_panic(expected: 'Can only renounce role for self')]
fn test_renounceRole_unauthorized() {
let mut state = setup();
start_cheat_caller_address(test_address(), ADMIN());
Expand Down Expand Up @@ -423,7 +423,7 @@ fn test_new_admin_can_revoke_roles() {
}

#[test]
#[should_panic(expected: ('Caller is missing role',))]
#[should_panic(expected: 'Caller is missing role')]
fn test_previous_admin_cannot_grant_roles() {
let mut state = setup();
state.set_role_admin(ROLE, OTHER_ROLE);
Expand All @@ -432,7 +432,7 @@ fn test_previous_admin_cannot_grant_roles() {
}

#[test]
#[should_panic(expected: ('Caller is missing role',))]
#[should_panic(expected: 'Caller is missing role')]
fn test_previous_admin_cannot_revoke_roles() {
let mut state = setup();
state.set_role_admin(ROLE, OTHER_ROLE);
Expand Down
16 changes: 8 additions & 8 deletions packages/access/src/tests/test_ownable.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fn test_initializer_owner() {
}

#[test]
#[should_panic(expected: ('New owner is the zero address',))]
#[should_panic(expected: 'New owner is the zero address')]
fn test_initializer_zero_owner() {
let mut state = COMPONENT_STATE();
state.initializer(ZERO());
Expand All @@ -63,7 +63,7 @@ fn test_assert_only_owner() {
}

#[test]
#[should_panic(expected: ('Caller is not the owner',))]
#[should_panic(expected: 'Caller is not the owner')]
fn test_assert_only_owner_when_not_owner() {
let state = setup();
start_cheat_caller_address(test_address(), OTHER());
Expand Down Expand Up @@ -117,15 +117,15 @@ fn test_transfer_ownership() {
}

#[test]
#[should_panic(expected: ('New owner is the zero address',))]
#[should_panic(expected: 'New owner is the zero address')]
fn test_transfer_ownership_to_zero() {
let mut state = setup();
start_cheat_caller_address(test_address(), OWNER());
state.transfer_ownership(ZERO());
}

#[test]
#[should_panic(expected: ('Caller is not the owner',))]
#[should_panic(expected: 'Caller is not the owner')]
fn test_transfer_ownership_from_nonowner() {
let mut state = setup();
start_cheat_caller_address(test_address(), OTHER());
Expand All @@ -145,15 +145,15 @@ fn test_transferOwnership() {
}

#[test]
#[should_panic(expected: ('New owner is the zero address',))]
#[should_panic(expected: 'New owner is the zero address')]
fn test_transferOwnership_to_zero() {
let mut state = setup();
start_cheat_caller_address(test_address(), OWNER());
state.transferOwnership(ZERO());
}

#[test]
#[should_panic(expected: ('Caller is not the owner',))]
#[should_panic(expected: 'Caller is not the owner')]
fn test_transferOwnership_from_nonowner() {
let mut state = setup();
start_cheat_caller_address(test_address(), OTHER());
Expand All @@ -177,7 +177,7 @@ fn test_renounce_ownership() {
}

#[test]
#[should_panic(expected: ('Caller is not the owner',))]
#[should_panic(expected: 'Caller is not the owner')]
fn test_renounce_ownership_from_nonowner() {
let mut state = setup();
start_cheat_caller_address(test_address(), OTHER());
Expand All @@ -197,7 +197,7 @@ fn test_renounceOwnership() {
}

#[test]
#[should_panic(expected: ('Caller is not the owner',))]
#[should_panic(expected: 'Caller is not the owner')]
fn test_renounceOwnership_from_nonowner() {
let mut state = setup();
start_cheat_caller_address(test_address(), OTHER());
Expand Down
12 changes: 6 additions & 6 deletions packages/access/src/tests/test_ownable_twostep.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ fn test_transfer_ownership_to_zero() {
}

#[test]
#[should_panic(expected: ('Caller is not the owner',))]
#[should_panic(expected: 'Caller is not the owner')]
fn test_transfer_ownership_from_nonowner() {
let mut state = setup();
start_cheat_caller_address(test_address(), OTHER());
Expand Down Expand Up @@ -138,7 +138,7 @@ fn test_transferOwnership_to_zero() {
}

#[test]
#[should_panic(expected: ('Caller is not the owner',))]
#[should_panic(expected: 'Caller is not the owner')]
fn test_transferOwnership_from_nonowner() {
let mut state = setup();
start_cheat_caller_address(test_address(), OTHER());
Expand All @@ -165,7 +165,7 @@ fn test_accept_ownership() {
}

#[test]
#[should_panic(expected: ('Caller is not the pending owner',))]
#[should_panic(expected: 'Caller is not the pending owner')]
fn test_accept_ownership_from_nonpending() {
let mut state = setup();
state.Ownable_pending_owner.write(NEW_OWNER());
Expand All @@ -189,7 +189,7 @@ fn test_acceptOwnership() {
}

#[test]
#[should_panic(expected: ('Caller is not the pending owner',))]
#[should_panic(expected: 'Caller is not the pending owner')]
fn test_acceptOwnership_from_nonpending() {
let mut state = setup();
state.Ownable_pending_owner.write(NEW_OWNER());
Expand Down Expand Up @@ -231,7 +231,7 @@ fn test_renounce_ownership_resets_pending_owner() {
}

#[test]
#[should_panic(expected: ('Caller is not the owner',))]
#[should_panic(expected: 'Caller is not the owner')]
fn test_renounce_ownership_from_nonowner() {
let mut state = setup();
start_cheat_caller_address(test_address(), OTHER());
Expand All @@ -252,7 +252,7 @@ fn test_renounceOwnership() {
}

#[test]
#[should_panic(expected: ('Caller is not the owner',))]
#[should_panic(expected: 'Caller is not the owner')]
fn test_renounceOwnership_from_nonowner() {
let mut state = setup();
start_cheat_caller_address(test_address(), OTHER());
Expand Down
2 changes: 1 addition & 1 deletion packages/security/src/tests/test_initializable.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn test_initialize() {
}

#[test]
#[should_panic(expected: ('Initializable: is initialized',))]
#[should_panic(expected: 'Initializable: is initialized')]
fn test_initialize_when_initialized() {
let mut state = COMPONENT_STATE();
state.initialize();
Expand Down
8 changes: 4 additions & 4 deletions packages/security/src/tests/test_pausable.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fn test_assert_paused_when_paused() {
}

#[test]
#[should_panic(expected: ('Pausable: not paused',))]
#[should_panic(expected: 'Pausable: not paused')]
fn test_assert_paused_when_not_paused() {
let state = COMPONENT_STATE();
state.assert_paused();
Expand All @@ -53,7 +53,7 @@ fn test_assert_paused_when_not_paused() {
//

#[test]
#[should_panic(expected: ('Pausable: paused',))]
#[should_panic(expected: 'Pausable: paused')]
fn test_assert_not_paused_when_paused() {
let mut state = COMPONENT_STATE();
state.pause();
Expand Down Expand Up @@ -84,7 +84,7 @@ fn test_pause_when_unpaused() {
}

#[test]
#[should_panic(expected: ('Pausable: paused',))]
#[should_panic(expected: 'Pausable: paused')]
fn test_pause_when_paused() {
let mut state = COMPONENT_STATE();
state.pause();
Expand All @@ -111,7 +111,7 @@ fn test_unpause_when_paused() {
}

#[test]
#[should_panic(expected: ('Pausable: not paused',))]
#[should_panic(expected: 'Pausable: not paused')]
fn test_unpause_when_unpaused() {
let mut state = COMPONENT_STATE();
assert!(!state.is_paused());
Expand Down
8 changes: 4 additions & 4 deletions packages/security/src/tests/test_reentrancyguard.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fn test_reentrancy_guard_start() {
}

#[test]
#[should_panic(expected: ('ReentrancyGuard: reentrant call',))]
#[should_panic(expected: 'ReentrancyGuard: reentrant call')]
fn test_reentrancy_guard_start_when_started() {
let mut state = COMPONENT_STATE();

Expand Down Expand Up @@ -64,7 +64,7 @@ fn test_reentrancy_guard_end() {
//

#[test]
#[should_panic(expected: ('ReentrancyGuard: reentrant call',))]
#[should_panic(expected: 'ReentrancyGuard: reentrant call')]
fn test_remote_callback() {
let contract = deploy_mock();

Expand All @@ -76,14 +76,14 @@ fn test_remote_callback() {
}

#[test]
#[should_panic(expected: ('ReentrancyGuard: reentrant call',))]
#[should_panic(expected: 'ReentrancyGuard: reentrant call')]
fn test_local_recursion() {
let contract = deploy_mock();
contract.count_local_recursive(10);
}

#[test]
#[should_panic(expected: ('ReentrancyGuard: reentrant call',))]
#[should_panic(expected: 'ReentrancyGuard: reentrant call')]
fn test_external_recursion() {
let contract = deploy_mock();
contract.count_external_recursive(10);
Expand Down

0 comments on commit ab162d7

Please sign in to comment.