Skip to content

Commit

Permalink
remove test since already covered in slt
Browse files Browse the repository at this point in the history
  • Loading branch information
shehabgamin committed Jan 27, 2025
1 parent e7d474d commit 1f826cb
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions datafusion/optimizer/src/analyzer/type_coercion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2177,33 +2177,4 @@ mod test {
),
}
}

#[test]
fn test_ascii_expr() -> Result<()> {
let input = Arc::new(StringArray::from(vec![Some("x")])) as ArrayRef;
let batch = RecordBatch::try_from_iter([("c0", input)])?;
let df_schema = DFSchema::try_from(batch.schema())?;
let expected = Arc::new(Int32Array::from(vec![Some(120)])) as ArrayRef;
let result = evaluate_expr_with_array(ascii(col("c0")), batch, &df_schema)?;
assert_eq!(&expected, &result);

let input = ScalarValue::Utf8(Some(String::from("x")));
let expected = ScalarValue::Int32(Some(120));
let result = evaluate_expr_with_scalar(ascii(lit(input)))?;
assert_eq!(&expected, &result);

let input = Arc::new(Int32Array::from(vec![Some(2)])) as ArrayRef;
let batch = RecordBatch::try_from_iter([("c0", input)])?;
let df_schema = DFSchema::try_from(batch.schema())?;
let expected = Arc::new(Int32Array::from(vec![Some(50)])) as ArrayRef;
let result = evaluate_expr_with_array(ascii(col("c0")), batch, &df_schema)?;
assert_eq!(&expected, &result);

let input = ScalarValue::Int32(Some(2));
let expected = ScalarValue::Int32(Some(50));
let result = evaluate_expr_with_scalar(ascii(lit(input)))?;
assert_eq!(&expected, &result);

Ok(())
}
}

0 comments on commit 1f826cb

Please sign in to comment.