Skip to content

Commit

Permalink
tests: remove frequency property tests flakiness when randomly ge…
Browse files Browse the repository at this point in the history
…nerated test data has "\u{FEFF}"

just don't do the test when the BOM character is in the random test data
  • Loading branch information
jqnatividad committed Aug 18, 2024
1 parent 07baab7 commit f90b543
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/test_frequency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,9 +671,19 @@ fn prop_frequency_indexed() {
}

fn param_prop_frequency(name: &str, rows: CsvData, idx: bool) -> bool {
if !rows.is_empty() && rows[0][0].len() == 3 && rows[0][0] == "\u{FEFF}" {
if !rows.is_empty() {
return true;
}

let rows_check = rows.clone();

for row in rows_check.into_iter() {
for field in row.into_iter() {
if field.contains("\u{FEFF}") {
return true;
}
}
}
let wrk = Workdir::new(name);
if idx {
wrk.create_indexed("in.csv", rows.clone());
Expand Down

0 comments on commit f90b543

Please sign in to comment.