Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
k88hudson-cfa committed Nov 30, 2024
1 parent 445c911 commit a4500e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/people.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1982,7 +1982,7 @@ mod test {
assert_eq!(cols.get_columns(), vec!["Age", "RiskCategoryType"]);
}

fn get_counts_test_setup<T: Tabulator>(
fn tabulate_properties_test_setup<T: Tabulator>(
tabulator: &T,
setup: impl FnOnce(&mut Context),
expected_values: &HashSet<(Vec<String>, usize)>,
Expand All @@ -2001,12 +2001,12 @@ mod test {
}

#[test]
fn test_get_counts() {
fn test_periodic_report() {
let tabulator = (IsRunner,);
let mut expected = HashSet::new();
expected.insert((vec!["true".to_string()], 1));
expected.insert((vec!["false".to_string()], 1));
get_counts_test_setup(
tabulate_properties_test_setup(
&tabulator,
|context| {
let bob = context.add_person(()).unwrap();
Expand All @@ -2026,7 +2026,7 @@ mod test {
expected.insert((vec!["true".to_string(), "false".to_string()], 1));
expected.insert((vec!["true".to_string(), "true".to_string()], 1));

get_counts_test_setup(
tabulate_properties_test_setup(
&tabulator,
|context| {
context.add_person(()).unwrap();
Expand Down
8 changes: 4 additions & 4 deletions src/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,11 +542,11 @@ mod test {
config
.file_prefix("test_".to_string())
.directory(path.clone());
let _ = context.add_periodic_report("periodic", 1.0, (IsRunner,));
let _ = context.add_periodic_report("periodic", 1.2, (IsRunner,));
let person = context.add_person(()).unwrap();
context.add_person(()).unwrap();

context.add_plan(1.0, move |context: &mut Context| {
context.add_plan(1.2, move |context: &mut Context| {
context.set_person_property(person, IsRunner, true);
});

Expand All @@ -566,8 +566,8 @@ mod test {
.collect();
let mut expected = vec![
vec!["0", "false", "2"],
vec!["1", "false", "1"],
vec!["1", "true", "1"],
vec!["1.2", "false", "1"],
vec!["1.2", "true", "1"],
];

actual.sort();
Expand Down

0 comments on commit a4500e5

Please sign in to comment.