Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
comphead committed Mar 21, 2024
1 parent 2255f4d commit f2c8a16
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion datafusion/core/tests/fuzz_cases/aggregate_fuzz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use tokio::task::JoinSet;
/// same results
#[tokio::test(flavor = "multi_thread")]
async fn streaming_aggregate_test() {
let test_cases = vec![
let test_cases = [
vec!["a"],
vec!["b", "a"],
vec!["c", "a"],
Expand Down
2 changes: 1 addition & 1 deletion datafusion/expr/src/expr_rewriter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ mod test {
let expr = col("a") + col("b");
let schema_a =
make_schema_with_empty_metadata(vec![make_field("\"tableA\"", "a")]);
let schemas = vec![schema_a];
let schemas = [schema_a];
let schemas = schemas.iter().collect::<Vec<_>>();

let error =
Expand Down
4 changes: 2 additions & 2 deletions datafusion/functions/benches/regx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn data(rng: &mut ThreadRng) -> StringArray {
}

fn regex(rng: &mut ThreadRng) -> StringArray {
let samples = vec![
let samples = [
".*([A-Z]{1}).*".to_string(),
"^(A).*".to_string(),
r#"[\p{Letter}-]+"#.to_string(),
Expand All @@ -60,7 +60,7 @@ fn regex(rng: &mut ThreadRng) -> StringArray {
}

fn flags(rng: &mut ThreadRng) -> StringArray {
let samples = vec![Some("i".to_string()), Some("im".to_string()), None];
let samples = [Some("i".to_string()), Some("im".to_string()), None];
let mut sb = StringBuilder::new();
for _ in 0..1000 {
let sample = samples.choose(rng).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/benches/to_char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn data(rng: &mut ThreadRng) -> Date32Array {
}

fn patterns(rng: &mut ThreadRng) -> StringArray {
let samples = vec![
let samples = [
"%Y:%m:%d".to_string(),
"%d-%m-%Y".to_string(),
"%d%m%Y".to_string(),
Expand Down
6 changes: 3 additions & 3 deletions datafusion/physical-expr/src/equivalence/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,19 +535,19 @@ mod tests {

#[test]
fn test_remove_redundant_entries_eq_group() -> Result<()> {
let entries = vec![
let entries = [
EquivalenceClass::new(vec![lit(1), lit(1), lit(2)]),
// This group is meaningless should be removed
EquivalenceClass::new(vec![lit(3), lit(3)]),
EquivalenceClass::new(vec![lit(4), lit(5), lit(6)]),
];
// Given equivalences classes are not in succinct form.
// Expected form is the most plain representation that is functionally same.
let expected = vec![
let expected = [
EquivalenceClass::new(vec![lit(1), lit(2)]),
EquivalenceClass::new(vec![lit(4), lit(5), lit(6)]),
];
let mut eq_groups = EquivalenceGroup::new(entries);
let mut eq_groups = EquivalenceGroup::new(entries.to_vec());
eq_groups.remove_redundant_entries();

let eq_groups = eq_groups.classes;
Expand Down
4 changes: 2 additions & 2 deletions datafusion/physical-expr/src/equivalence/ordering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ mod tests {
// Generate a data that satisfies properties given
let table_data_with_properties =
generate_table_for_eq_properties(&eq_properties, N_ELEMENTS, N_DISTINCT)?;
let col_exprs = vec![
let col_exprs = [
col("a", &test_schema)?,
col("b", &test_schema)?,
col("c", &test_schema)?,
Expand Down Expand Up @@ -815,7 +815,7 @@ mod tests {
Operator::Plus,
col("b", &test_schema)?,
)) as Arc<dyn PhysicalExpr>;
let exprs = vec![
let exprs = [
col("a", &test_schema)?,
col("b", &test_schema)?,
col("c", &test_schema)?,
Expand Down
2 changes: 1 addition & 1 deletion datafusion/physical-expr/src/equivalence/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1793,7 +1793,7 @@ mod tests {
Operator::Plus,
col("b", &test_schema)?,
)) as Arc<dyn PhysicalExpr>;
let exprs = vec![
let exprs = [
col("a", &test_schema)?,
col("b", &test_schema)?,
col("c", &test_schema)?,
Expand Down

0 comments on commit f2c8a16

Please sign in to comment.