@@ -6861,6 +6861,8 @@ fn parse_searched_case_expr() {
68616861 let select = verified_only_select(sql);
68626862 assert_eq!(
68636863 &Case {
6864+ case_token: AttachedToken::empty(),
6865+ end_token: AttachedToken::empty(),
68646866 operand: None,
68656867 conditions: vec![
68666868 CaseWhen {
@@ -6900,6 +6902,8 @@ fn parse_simple_case_expr() {
69006902 use self::Expr::{Case, Identifier};
69016903 assert_eq!(
69026904 &Case {
6905+ case_token: AttachedToken::empty(),
6906+ end_token: AttachedToken::empty(),
69036907 operand: Some(Box::new(Identifier(Ident::new("foo")))),
69046908 conditions: vec![CaseWhen {
69056909 condition: Expr::value(number("1")),
@@ -14464,6 +14468,16 @@ fn test_case_statement_span() {
1446414468 );
1446514469}
1446614470
14471+ #[test]
14472+ fn test_case_expr_span() {
14473+ let sql = "CASE 1 WHEN 2 THEN 3 ELSE 4 END";
14474+ let mut parser = Parser::new(&GenericDialect {}).try_with_sql(sql).unwrap();
14475+ assert_eq!(
14476+ parser.parse_expr().unwrap().span(),
14477+ Span::new(Location::new(1, 1), Location::new(1, sql.len() as u64 + 1))
14478+ );
14479+ }
14480+
1446714481#[test]
1446814482fn parse_if_statement() {
1446914483 let dialects = all_dialects_except(|d| d.is::<MsSqlDialect>());
@@ -14642,6 +14656,8 @@ fn test_lambdas() {
1464214656 Expr::Lambda(LambdaFunction {
1464314657 params: OneOrManyWithParens::Many(vec![Ident::new("p1"), Ident::new("p2")]),
1464414658 body: Box::new(Expr::Case {
14659+ case_token: AttachedToken::empty(),
14660+ end_token: AttachedToken::empty(),
1464514661 operand: None,
1464614662 conditions: vec![
1464714663 CaseWhen {
0 commit comments