More code coverage

This commit is contained in:
Dandaedre 2025-03-05 20:05:36 +01:00
parent 4f2bb22420
commit 5a84833922
Signed by: Dandaedre
GPG Key ID: 440C6592E8A26D99
4 changed files with 22 additions and 3 deletions

View File

@ -316,3 +316,15 @@ pub trait Scenario where for<'a> &'a <<<Self as Scenario>::InitialEquipementList
)
}
}
#[cfg(test)]
mod test {
use super::RecipeCollection;
use crate::weaponry_structs::{InitialEquipementList, equipement_structs::EqShape};
#[test]
fn test_from_iter_intermediate() {
let _b = <InitialEquipementList as RecipeCollection>::from_iter_intermediate::<EqShape>(
[Ok(EqShape::default()), Ok(EqShape::default())].into_iter(),
);
}
}

View File

@ -45,7 +45,8 @@ pub struct RefinedEquipement {
/// The complete equipement list, refined with all advanced stats
pub struct RefinedEquipementList {
/// Inner list of Refined Equipements
inner: Vec<RefinedEquipement>,
// TODO[!]: The use of pub stays for the usage of the example showcasing the macro in export
pub inner: Vec<RefinedEquipement>,
}
// DONE: The use of Deref could be a subtle gotcha

View File

@ -57,6 +57,7 @@ pub struct IndividualElementsScenario {
impl CrossRecipeScenario {
/// Generate all the operations to be processed with the current config
// TODO[!]: Consider adding to interface
fn generate_selected_operation(
&self,
) -> Result<Vec<InitialEquipementList>, FatalEquipementError> {
@ -134,3 +135,9 @@ impl Scenario for CrossRecipeScenario {
&self.database
}
}
#[cfg(test)]
mod test {
#[test]
fn test_scenario() {}
}

View File

@ -273,8 +273,7 @@ impl From<InnerEquipementStats> for EqFinishing {
#[cfg(test)]
mod test {
use super::{
EqFinishing, EqMaterial, EqNature, EqShape, Equipement, InitialEquipementList,
InnerEquipementStats,
EqFinishing, EqMaterial, EqShape, Equipement, InitialEquipementList, InnerEquipementStats,
};
use crate::interfaces::RecipeCollection;