Create struct scheduler to encapsulate the search logic

This commit is contained in:
2026-01-14 00:34:48 +02:00
parent d7d4b109c3
commit 2febcb7344
4 changed files with 147 additions and 143 deletions

View File

@@ -164,8 +164,8 @@ mod tests {
use rstest::{fixture, rstest};
use crate::{
bounds::WorkloadBounds, config::UserConfig, generator::backtracking, resident::Resident,
schedule::MonthlySchedule, slot::Slot,
bounds::WorkloadBounds, config::UserConfig, resident::Resident, schedule::MonthlySchedule,
scheduler::Scheduler, slot::Slot,
};
#[fixture]
@@ -190,13 +190,14 @@ mod tests {
WorkloadBounds::new_with_config(&config)
}
#[fixture]
fn scheduler(config: UserConfig, bounds: WorkloadBounds) -> Scheduler {
Scheduler::new(config, bounds)
}
#[rstest]
pub fn test_export_as_doc(
mut schedule: MonthlySchedule,
config: UserConfig,
bounds: WorkloadBounds,
) {
backtracking(&mut schedule, Slot::default(), &config, &bounds);
schedule.export_as_doc(&config);
pub fn test_export_as_doc(mut schedule: MonthlySchedule, scheduler: Scheduler) {
scheduler.search(&mut schedule, Slot::default());
schedule.export_as_doc(&scheduler.config);
}
}