message: [pdsl_core] Rewrite key unit tests to use the new test_utils
diff: @@ -253,20 +253,26 @@ impl core::ops::SubAssign<u64> for Key {
  mod tests {
  use super::*;
  - use crate::env::{Env, ContractEnv};
  + use crate::{
  + test_utils::run_test,
  + env::{Env, ContractEnv},
  + };
  #[test]
  fn store_load_clear() {
  + run_test(|| {
  let key = Key([0x42; 32]);
  assert_eq!(unsafe { ContractEnv::load(key) }, None);
  unsafe { ContractEnv::store(key, &[0x5]); }
  assert_eq!(unsafe { ContractEnv::load(key) }, Some(vec![0x5]));
  unsafe { ContractEnv::clear(key); }
  assert_eq!(unsafe { ContractEnv::load(key) }, None);
  + })
  }
  #[test]
  fn key_add() {
  + run_test(|| {
  let key00 = Key([0x0; 32]);
  let key05 = key00 + 5_u32; // -> 5
  let key10 = key00 + 10_u32; // -> 10 | same as key55
  @@ -275,10 +281,12 @@ mod tests {
  assert_eq!(unsafe { ContractEnv::load(key10) }, Some(vec![42]));
  unsafe { ContractEnv::store(key10, &[13, 37]); }
  assert_eq!(unsafe { ContractEnv::load(key55) }, Some(vec![13, 37]));
  + })
  }
  #[test]
  fn key_add_sub() {
  + run_test(|| {
  let key0a = Key([0x0; 32]);
  unsafe { ContractEnv::store(key0a, &[0x01]); }
  let key1a = key0a + 1337_u32;
  @@ -292,10 +300,12 @@ mod tests {
  assert_eq!(unsafe { ContractEnv::load(key1b) }, Some(vec![0x01]));
  let key0b = key1b + 2000_u32 - 663_u32;
  assert_eq!(unsafe { ContractEnv::load(key0b) }, Some(vec![0x02]));
  + })
  }
  #[test]
  fn key_sub() {
  + run_test(|| {
  assert_eq!(
  Key([0x42; 32]) - 0_u32,
  Key([0x42; 32])
  @@ -355,17 +365,21 @@ mod tests {
  expected_c
  );
  }
  + })
  }
  #[test]
  fn as_bytes() {
  + run_test(|| {
  let mut key = Key([0x42; 32]);
  assert_eq!(key.as_bytes(), &[0x42; 32]);
  assert_eq!(key.as_bytes_mut(), &mut [0x42; 32]);
  + })
  }
  #[test]
  fn key_diff() {
  + run_test(|| {
  let key1 = Key([0x0; 32]);
  let key2 = key1 + 0x42_u32;
  let key3 = key1 + u32::max_value() + 1_u32;
  @@ -420,5 +434,6 @@ mod tests {
  (key4 - key3).try_to_u64(),
  Some(u64::max_value() - (u32::max_value() as u64 + 1))
  );
  + })
  }
  }
  