mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-04-29 13:38:00 +00:00
Add support for address replacement
This commit is contained in:
@@ -3,6 +3,7 @@ use serde::Deserialize;
|
||||
use crate::{
|
||||
define_wrapper_type,
|
||||
input::{Expected, Input},
|
||||
metadata::AddressReplacementMap,
|
||||
mode::Mode,
|
||||
};
|
||||
|
||||
@@ -16,6 +17,21 @@ pub struct Case {
|
||||
pub expected: Option<Expected>,
|
||||
}
|
||||
|
||||
impl Case {
|
||||
pub fn handle_address_replacement(
|
||||
&mut self,
|
||||
old_to_new_mapping: &mut AddressReplacementMap,
|
||||
) -> anyhow::Result<()> {
|
||||
for input in self.inputs.iter_mut() {
|
||||
input.handle_address_replacement(old_to_new_mapping)?;
|
||||
}
|
||||
if let Some(ref mut expected) = self.expected {
|
||||
expected.handle_address_replacement(old_to_new_mapping)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
define_wrapper_type!(
|
||||
/// A wrapper type for the index of test cases found in metadata file.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
|
||||
Reference in New Issue
Block a user