Skip to content

Commit 5b35001

Browse files
authored
Random test cleanups use Expr::value (#1749)
1 parent 3adc746 commit 5b35001

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

tests/sqlparser_clickhouse.rs

+6-16
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,7 @@ fn parse_map_access_expr() {
5555
"indexOf",
5656
[
5757
Expr::Identifier(Ident::new("string_names")),
58-
Expr::Value(
59-
(Value::SingleQuotedString("endpoint".to_string()))
60-
.with_empty_span()
61-
)
58+
Expr::value(Value::SingleQuotedString("endpoint".to_string()))
6259
]
6360
),
6461
})],
@@ -74,9 +71,7 @@ fn parse_map_access_expr() {
7471
left: Box::new(BinaryOp {
7572
left: Box::new(Identifier(Ident::new("id"))),
7673
op: BinaryOperator::Eq,
77-
right: Box::new(Expr::Value(
78-
(Value::SingleQuotedString("test".to_string())).with_empty_span()
79-
)),
74+
right: Box::new(Expr::value(Value::SingleQuotedString("test".to_string()))),
8075
}),
8176
op: BinaryOperator::And,
8277
right: Box::new(BinaryOp {
@@ -87,18 +82,13 @@ fn parse_map_access_expr() {
8782
"indexOf",
8883
[
8984
Expr::Identifier(Ident::new("string_name")),
90-
Expr::Value(
91-
(Value::SingleQuotedString("app".to_string()))
92-
.with_empty_span()
93-
)
85+
Expr::value(Value::SingleQuotedString("app".to_string()))
9486
]
9587
),
9688
})],
9789
}),
9890
op: BinaryOperator::NotEq,
99-
right: Box::new(Expr::Value(
100-
(Value::SingleQuotedString("foo".to_string())).with_empty_span()
101-
)),
91+
right: Box::new(Expr::value(Value::SingleQuotedString("foo".to_string()))),
10292
}),
10393
}),
10494
group_by: GroupByExpr::Expressions(vec![], vec![]),
@@ -124,8 +114,8 @@ fn parse_array_expr() {
124114
assert_eq!(
125115
&Expr::Array(Array {
126116
elem: vec![
127-
Expr::Value((Value::SingleQuotedString("1".to_string())).with_empty_span()),
128-
Expr::Value((Value::SingleQuotedString("2".to_string())).with_empty_span()),
117+
Expr::value(Value::SingleQuotedString("1".to_string())),
118+
Expr::value(Value::SingleQuotedString("2".to_string())),
129119
],
130120
named: false,
131121
}),

0 commit comments

Comments
 (0)