From f90b5434b1f48215ee7b5e1d855ef76f98cc59d0 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Sun, 18 Aug 2024 09:13:45 -0400 Subject: [PATCH] `tests`: remove `frequency` property tests flakiness when randomly generated test data has "\u{FEFF}" just don't do the test when the BOM character is in the random test data --- tests/test_frequency.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/test_frequency.rs b/tests/test_frequency.rs index 4d32fa9f4..84048f506 100644 --- a/tests/test_frequency.rs +++ b/tests/test_frequency.rs @@ -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());