diff --git a/accounts-db/src/account_storage.rs b/accounts-db/src/account_storage.rs index ba3542f0ff49e8..7178d62dd6c1c5 100644 --- a/accounts-db/src/account_storage.rs +++ b/accounts-db/src/account_storage.rs @@ -352,7 +352,7 @@ pub(crate) mod tests { } #[test] - #[should_panic(expected = "assertion failed: self.no_shrink_in_progress()")] + #[should_panic(expected = "self.no_shrink_in_progress()")] fn test_get_slot_storage_entry_fail() { let storage = AccountStorage::default(); storage @@ -362,7 +362,7 @@ pub(crate) mod tests { } #[test] - #[should_panic(expected = "assertion failed: self.no_shrink_in_progress()")] + #[should_panic(expected = "self.no_shrink_in_progress()")] fn test_all_slots_fail() { let storage = AccountStorage::default(); storage @@ -372,7 +372,7 @@ pub(crate) mod tests { } #[test] - #[should_panic(expected = "assertion failed: self.no_shrink_in_progress()")] + #[should_panic(expected = "self.no_shrink_in_progress()")] fn test_initialize_fail() { let mut storage = AccountStorage::default(); storage @@ -382,9 +382,7 @@ pub(crate) mod tests { } #[test] - #[should_panic( - expected = "assertion failed: shrink_can_be_active || self.shrink_in_progress_map.is_empty()" - )] + #[should_panic(expected = "shrink_can_be_active || self.shrink_in_progress_map.is_empty()")] fn test_remove_fail() { let storage = AccountStorage::default(); storage @@ -394,7 +392,7 @@ pub(crate) mod tests { } #[test] - #[should_panic(expected = "assertion failed: self.no_shrink_in_progress()")] + #[should_panic(expected = "self.no_shrink_in_progress()")] fn test_iter_fail() { let storage = AccountStorage::default(); storage @@ -404,7 +402,7 @@ pub(crate) mod tests { } #[test] - #[should_panic(expected = "assertion failed: self.no_shrink_in_progress()")] + #[should_panic(expected = "self.no_shrink_in_progress()")] fn test_insert_fail() { let storage = AccountStorage::default(); let sample = storage.get_test_storage(); diff --git a/accounts-db/src/accounts_db.rs b/accounts-db/src/accounts_db.rs index 414b81200be9bb..fbb1c154cc1ad2 100644 --- a/accounts-db/src/accounts_db.rs +++ b/accounts-db/src/accounts_db.rs @@ -17764,7 +17764,7 @@ pub mod tests { } #[test] - #[should_panic(expected = "assertion failed: self.storage.remove")] + #[should_panic(expected = "self.storage.remove")] fn test_handle_dropped_roots_for_ancient_assert() { solana_logger::setup(); let common_store_path = Path::new(""); diff --git a/accounts-db/src/ancient_append_vecs.rs b/accounts-db/src/ancient_append_vecs.rs index 5ee5ccd967863a..27f0eaee0dbc1b 100644 --- a/accounts-db/src/ancient_append_vecs.rs +++ b/accounts-db/src/ancient_append_vecs.rs @@ -993,7 +993,7 @@ pub mod tests { #[test] #[should_panic( - expected = "assertion failed: accounts_to_combine.target_slots_sorted.len() >= packed_contents.len()" + expected = "accounts_to_combine.target_slots_sorted.len() >= packed_contents.len()" )] fn test_write_packed_storages_too_few_slots() { let (db, storages, slots, _infos) = get_sample_storages(1, None); diff --git a/accounts-db/src/append_vec.rs b/accounts-db/src/append_vec.rs index e0163b4294d15d..765fa97fdc200e 100644 --- a/accounts-db/src/append_vec.rs +++ b/accounts-db/src/append_vec.rs @@ -732,7 +732,7 @@ pub mod tests { static_assertions::assert_eq_align!(u64, StoredMeta, AccountMeta); #[test] - #[should_panic(expected = "assertion failed: accounts.has_hash_and_write_version()")] + #[should_panic(expected = "accounts.has_hash_and_write_version()")] fn test_storable_accounts_with_hashes_and_write_versions_new() { let account = AccountSharedData::default(); // for (Slot, &'a [(&'a Pubkey, &'a T)], IncludeSlotInHash) diff --git a/accounts-db/src/rolling_bit_field.rs b/accounts-db/src/rolling_bit_field.rs index 5c2fbcadcde748..1b520e4b5eef63 100644 --- a/accounts-db/src/rolling_bit_field.rs +++ b/accounts-db/src/rolling_bit_field.rs @@ -477,13 +477,13 @@ pub mod tests { } #[test] - #[should_panic(expected = "assertion failed: max_width.is_power_of_two()")] + #[should_panic(expected = "max_width.is_power_of_two()")] fn test_bitfield_power_2() { let _ = RollingBitField::new(3); } #[test] - #[should_panic(expected = "assertion failed: max_width > 0")] + #[should_panic(expected = "max_width > 0")] fn test_bitfield_0() { let _ = RollingBitField::new(0); } diff --git a/bucket_map/src/bucket_storage.rs b/bucket_map/src/bucket_storage.rs index 14aeaa6df8480c..7e1afe6bc56132 100644 --- a/bucket_map/src/bucket_storage.rs +++ b/bucket_map/src/bucket_storage.rs @@ -538,7 +538,9 @@ mod test { } #[test] - #[should_panic(expected = "assertion failed: `(left == right)`")] + // rust 1.73+ (our as-of-writing nightly version) changed panic message. we're stuck with this + // short common substring until the monorepo is fully 1.73+ including stable. + #[should_panic(expected = "left == right")] fn test_header_size() { _ = BucketStorage::::new_with_capacity( Arc::default(), diff --git a/entry/src/poh.rs b/entry/src/poh.rs index 573b1ab606334e..500ebaae9eb832 100644 --- a/entry/src/poh.rs +++ b/entry/src/poh.rs @@ -182,7 +182,7 @@ mod tests { } #[test] - #[should_panic(expected = "assertion failed: hashes_per_tick > 1")] + #[should_panic(expected = "hashes_per_tick > 1")] fn test_target_poh_time_hashes_per_tick() { let zero = Hash::default(); let poh = Poh::new(zero, Some(0)); diff --git a/runtime/src/bank/tests.rs b/runtime/src/bank/tests.rs index c3e1b611436254..0a7dbdb2a2cb34 100644 --- a/runtime/src/bank/tests.rs +++ b/runtime/src/bank/tests.rs @@ -3585,7 +3585,7 @@ fn test_bank_hash_internal_state_verify() { } #[test] -#[should_panic(expected = "assertion failed: self.is_frozen()")] +#[should_panic(expected = "self.is_frozen()")] fn test_verify_hash_unfrozen() { let bank = create_simple_test_bank(2_000); assert!(bank.verify_hash()); @@ -12459,7 +12459,7 @@ fn test_distribute_partitioned_epoch_rewards() { } #[test] -#[should_panic(expected = "assertion failed: self.epoch_schedule.get_slots_in_epoch")] +#[should_panic(expected = "self.epoch_schedule.get_slots_in_epoch")] fn test_distribute_partitioned_epoch_rewards_too_many_partitions() { let (genesis_config, _mint_keypair) = create_genesis_config(1_000_000 * LAMPORTS_PER_SOL); let mut bank = Bank::new_for_tests(&genesis_config); diff --git a/sdk/program/src/epoch_rewards.rs b/sdk/program/src/epoch_rewards.rs index 015dd97ec3dbb2..24bb596637b2af 100644 --- a/sdk/program/src/epoch_rewards.rs +++ b/sdk/program/src/epoch_rewards.rs @@ -66,7 +66,7 @@ mod tests { #[test] #[should_panic( - expected = "assertion failed: self.distributed_rewards.saturating_add(amount) <= self.total_rewards" + expected = "self.distributed_rewards.saturating_add(amount) <= self.total_rewards" )] fn test_epoch_rewards_distribute_panic() { let mut epoch_rewards = EpochRewards::new(100, 0, 64);