mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-04 06:18:17 +00:00
Random test cleanups use Expr::value (#1749)
This commit is contained in:
parent
3adc746b11
commit
5b3500139a
1 changed files with 6 additions and 16 deletions
|
@ -55,10 +55,7 @@ fn parse_map_access_expr() {
|
||||||
"indexOf",
|
"indexOf",
|
||||||
[
|
[
|
||||||
Expr::Identifier(Ident::new("string_names")),
|
Expr::Identifier(Ident::new("string_names")),
|
||||||
Expr::Value(
|
Expr::value(Value::SingleQuotedString("endpoint".to_string()))
|
||||||
(Value::SingleQuotedString("endpoint".to_string()))
|
|
||||||
.with_empty_span()
|
|
||||||
)
|
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
})],
|
})],
|
||||||
|
@ -74,9 +71,7 @@ fn parse_map_access_expr() {
|
||||||
left: Box::new(BinaryOp {
|
left: Box::new(BinaryOp {
|
||||||
left: Box::new(Identifier(Ident::new("id"))),
|
left: Box::new(Identifier(Ident::new("id"))),
|
||||||
op: BinaryOperator::Eq,
|
op: BinaryOperator::Eq,
|
||||||
right: Box::new(Expr::Value(
|
right: Box::new(Expr::value(Value::SingleQuotedString("test".to_string()))),
|
||||||
(Value::SingleQuotedString("test".to_string())).with_empty_span()
|
|
||||||
)),
|
|
||||||
}),
|
}),
|
||||||
op: BinaryOperator::And,
|
op: BinaryOperator::And,
|
||||||
right: Box::new(BinaryOp {
|
right: Box::new(BinaryOp {
|
||||||
|
@ -87,18 +82,13 @@ fn parse_map_access_expr() {
|
||||||
"indexOf",
|
"indexOf",
|
||||||
[
|
[
|
||||||
Expr::Identifier(Ident::new("string_name")),
|
Expr::Identifier(Ident::new("string_name")),
|
||||||
Expr::Value(
|
Expr::value(Value::SingleQuotedString("app".to_string()))
|
||||||
(Value::SingleQuotedString("app".to_string()))
|
|
||||||
.with_empty_span()
|
|
||||||
)
|
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
})],
|
})],
|
||||||
}),
|
}),
|
||||||
op: BinaryOperator::NotEq,
|
op: BinaryOperator::NotEq,
|
||||||
right: Box::new(Expr::Value(
|
right: Box::new(Expr::value(Value::SingleQuotedString("foo".to_string()))),
|
||||||
(Value::SingleQuotedString("foo".to_string())).with_empty_span()
|
|
||||||
)),
|
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
group_by: GroupByExpr::Expressions(vec![], vec![]),
|
group_by: GroupByExpr::Expressions(vec![], vec![]),
|
||||||
|
@ -124,8 +114,8 @@ fn parse_array_expr() {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
&Expr::Array(Array {
|
&Expr::Array(Array {
|
||||||
elem: vec![
|
elem: vec![
|
||||||
Expr::Value((Value::SingleQuotedString("1".to_string())).with_empty_span()),
|
Expr::value(Value::SingleQuotedString("1".to_string())),
|
||||||
Expr::Value((Value::SingleQuotedString("2".to_string())).with_empty_span()),
|
Expr::value(Value::SingleQuotedString("2".to_string())),
|
||||||
],
|
],
|
||||||
named: false,
|
named: false,
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue