Create struct scheduler to encapsulate the search logic
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user