Skip to content

Commit acbe537

Browse files
author
Cheng-Yuan-Lai
committed
refactor: simplify snapshot assertions by removing format calls in optimizer tests
1 parent d05123b commit acbe537

File tree

1 file changed

+5
-5
lines changed
  • datafusion/core/tests/optimizer

1 file changed

+5
-5
lines changed

datafusion/core/tests/optimizer/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ fn select_arrow_cast() {
5959
let sql = "SELECT arrow_cast(1234, 'Float64') as f64, arrow_cast('foo', 'LargeUtf8') as large";
6060
let plan = test_sql(sql).unwrap();
6161
assert_snapshot!(
62-
format!("{plan}"),
62+
plan,
6363
@r#"
6464
Projection: Float64(1234) AS f64, LargeUtf8("foo") AS large
6565
EmptyRelation
@@ -76,7 +76,7 @@ fn timestamp_nano_ts_none_predicates() -> Result<()> {
7676
// pushed down / pruned
7777
let plan = test_sql(sql).unwrap();
7878
assert_snapshot!(
79-
format!("{plan}"),
79+
plan,
8080
@r"
8181
Projection: test.col_int32
8282
Filter: test.col_ts_nano_none < TimestampNanosecond(1666612093000000000, None)
@@ -96,7 +96,7 @@ fn timestamp_nano_ts_utc_predicates() {
9696
// pushed down / pruned
9797
let plan = test_sql(sql).unwrap();
9898
assert_snapshot!(
99-
format!("{plan}"),
99+
plan,
100100
@r#"
101101
Projection: test.col_int32
102102
Filter: test.col_ts_nano_utc < TimestampNanosecond(1666612093000000000, Some("+00:00"))
@@ -112,7 +112,7 @@ fn concat_literals() -> Result<()> {
112112
FROM test";
113113
let plan = test_sql(sql).unwrap();
114114
assert_snapshot!(
115-
format!("{plan}"),
115+
plan,
116116
@r#"
117117
Projection: concat(Utf8("true"), CAST(test.col_int32 AS Utf8), Utf8("falsehello"), test.col_utf8, Utf8("123.4")) AS col
118118
TableScan: test projection=[col_int32, col_utf8]
@@ -128,7 +128,7 @@ fn concat_ws_literals() -> Result<()> {
128128
FROM test";
129129
let plan = test_sql(sql).unwrap();
130130
assert_snapshot!(
131-
format!("{plan}"),
131+
plan,
132132
@r#"
133133
Projection: concat_ws(Utf8("-"), Utf8("true"), CAST(test.col_int32 AS Utf8), Utf8("false-hello"), test.col_utf8, Utf8("12--3.4")) AS col
134134
TableScan: test projection=[col_int32, col_utf8]

0 commit comments

Comments
 (0)