mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-31 03:07:20 +00:00
Make numeric literal underscore test dialect agnostic (#1685)
This commit is contained in:
parent
9c384a9194
commit
94b2ff7191
2 changed files with 18 additions and 15 deletions
|
@ -55,6 +55,24 @@ use sqlparser::ast::Expr::{Identifier, UnaryOp};
|
|||
use sqlparser::ast::Value::Number;
|
||||
use sqlparser::test_utils::all_dialects_except;
|
||||
|
||||
#[test]
|
||||
fn parse_numeric_literal_underscore() {
|
||||
let dialects = all_dialects_where(|d| d.supports_numeric_literal_underscores());
|
||||
|
||||
let canonical = if cfg!(feature = "bigdecimal") {
|
||||
"SELECT 10000"
|
||||
} else {
|
||||
"SELECT 10_000"
|
||||
};
|
||||
|
||||
let select = dialects.verified_only_select_with_canonical("SELECT 10_000", canonical);
|
||||
|
||||
assert_eq!(
|
||||
select.projection,
|
||||
vec![UnnamedExpr(Expr::Value(number("10_000")))]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_insert_values() {
|
||||
let row = vec![
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue