Skip to content

Commit

Permalink
test: use assert_eq!(X, Ok(())) where possible for better error messa…
Browse files Browse the repository at this point in the history
…ge (#883)
  • Loading branch information
elintul committed Sep 19, 2024
1 parent 4bbbc5d commit 7da2d63
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/mempool/src/mempool_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ fn commit_block(
(contract_address!(address), AccountState { nonce: Nonce(felt!(nonce)) })
}));

assert!(mempool.commit_block(state_changes).is_ok());
assert_eq!(mempool.commit_block(state_changes), Ok(()));
}

/// Creates a valid input for mempool's `add_tx` with optional default values.
Expand Down
2 changes: 1 addition & 1 deletion crates/mempool_node/src/config/config_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ fn test_valid_component_execution_config(#[case] location: LocationType) {
remote_config,
..ComponentExecutionConfig::default()
};
assert!(component_exe_config.validate().is_ok());
assert_eq!(component_exe_config.validate(), Ok(()));
}

#[test]
Expand Down
4 changes: 2 additions & 2 deletions crates/papyrus_storage/src/mmap_file/mmap_file_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ fn config_validation() {
config.max_size = config.growth_step - 1;
assert!(config.validate().is_err());
config.max_size = 1 << 27;
assert!(config.validate().is_ok());
assert_eq!(config.validate(), Ok(()));

config.growth_step = config.max_object_size - 1;
assert!(config.validate().is_err());
config.growth_step = 1 << 20;
assert!(config.validate().is_ok());
assert_eq!(config.validate(), Ok(()));
}

#[test]
Expand Down

0 comments on commit 7da2d63

Please sign in to comment.