Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
confunguido committed Oct 23, 2024
1 parent fc361df commit f6bbe24
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions examples/births-deaths/population_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,6 @@ mod test {
fn test_birth_death(){
let mut context = Context::new();

// let parameters = ParametersValues {
// population: 10,
// seed: 123,
// birth_rate: 0.1,
// death_rate: 0.1
// };

let person = create_new_person(&mut context, -10.0);
context.add_plan(10.0, |context| {_=create_new_person(context, 10.0);});
context.add_plan(20.0, move |context| {attempt_death(context, person);});
Expand All @@ -253,9 +246,17 @@ mod test {
assert_eq!(population, 2);
}

// #[test]
// fn test_null_rates() {
// }
#[test]
fn test_null_rates() {
let parameters = ParametersValues {
population: 10,
seed: 123,
birth_rate: 0.0,
death_rate: 0.0
};
let mut context = Context::new();
assert_eq!(schedule_birth(&mut context), Err(""));
}


// #[test]
Expand Down

0 comments on commit f6bbe24

Please sign in to comment.