added the mutants from PR #4483

This commit is contained in:
ASuciuX
2024-03-26 14:24:59 +02:00
parent f9e9791a35
commit 0ff3ccbbd8
5 changed files with 15 additions and 1 deletions

1
Cargo.lock generated
View File

@@ -762,6 +762,7 @@ dependencies = [
"hashbrown 0.14.3",
"integer-sqrt",
"lazy_static",
"mutants",
"rand 0.8.5",
"rand_chacha 0.3.1",
"regex",

View File

@@ -31,6 +31,7 @@ stacks_common = { package = "stacks-common", path = "../stacks-common" }
rstest = "0.17.0"
rstest_reuse = "0.5.0"
hashbrown = { workspace = true }
mutants = "0.0.3"
[dependencies.serde_json]
version = "1.0"

View File

@@ -45,6 +45,7 @@ impl TraitsResolver {
TraitsResolver {}
}
#[cfg_attr(test, mutants::skip)]
pub fn run(&mut self, contract_ast: &mut ContractAST) -> ParseResult<()> {
let mut referenced_traits = HashMap::new();

View File

@@ -786,6 +786,9 @@ impl TrackerData {
/// `apply_updates` - tells this function to look for any changes in the cost voting contract
/// which would need to be applied. if `false`, just load the last computed cost state in this
/// fork.
/// TODO: #4587 add test for Err cases
/// Or keep the skip and remove the comment
#[cfg_attr(test, mutants::skip)]
fn load_costs(&mut self, clarity_db: &mut ClarityDatabase, apply_updates: bool) -> Result<()> {
clarity_db.begin();
let epoch_id = clarity_db

View File

@@ -1528,7 +1528,11 @@ impl TupleData {
pub fn is_empty(&self) -> bool {
self.data_map.is_empty()
}
///TODO: #4587 create default for TupleData, then check if the mutation tests are caught for the case:
/// Ok((Default::default()))
/// Or keep the skip and remove the comment
#[cfg_attr(test, mutants::skip)]
pub fn from_data(data: Vec<(ClarityName, Value)>) -> Result<TupleData> {
let mut type_map = BTreeMap::new();
let mut data_map = BTreeMap::new();
@@ -1545,6 +1549,10 @@ impl TupleData {
Self::new(TupleTypeSignature::try_from(type_map)?, data_map)
}
///TODO: #4587 create default for TupleData, then check if the mutation tests are caught for the case:
/// Ok((Default::default()))
/// Or keep the skip and remove the comment
#[cfg_attr(test, mutants::skip)]
pub fn from_data_typed(
epoch: &StacksEpochId,
data: Vec<(ClarityName, Value)>,