Skip to content

Commit d1d7afe

Browse files
committed
chore: move test
1 parent 6cf531d commit d1d7afe

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/ast/spans.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2469,4 +2469,16 @@ pub mod tests {
24692469

24702470
assert_eq!(test.get_source(body_span), "SELECT cte.* FROM cte");
24712471
}
2472+
2473+
#[test]
2474+
fn test_case_expr_span() {
2475+
let dialect = &GenericDialect;
2476+
let mut test = SpanTest::new(dialect, "CASE 1 WHEN 2 THEN 3 ELSE 4 END");
2477+
let expr = test.0.parse_expr().unwrap();
2478+
let expr_span = expr.span();
2479+
assert_eq!(
2480+
test.get_source(expr_span),
2481+
"CASE 1 WHEN 2 THEN 3 ELSE 4 END"
2482+
);
2483+
}
24722484
}

tests/sqlparser_common.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14468,16 +14468,6 @@ fn test_case_statement_span() {
1446814468
);
1446914469
}
1447014470

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-
1448114471
#[test]
1448214472
fn parse_if_statement() {
1448314473
let dialects = all_dialects_except(|d| d.is::<MsSqlDialect>());

0 commit comments

Comments
 (0)