Skip to content

Commit d7c1202

Browse files
Place regression tests beside related syntax cases
1 parent b053a8c commit d7c1202

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

‎tests/sqlparser_sqlite.rs‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,26 +1362,6 @@ fn parse_over_as_column_alias_after_function() {
13621362
);
13631363
}
13641364

1365-
#[test]
1366-
fn parse_bitwise_shift_operators() {
1367-
sqlite().verified_stmt("SELECT a << 1 FROM t");
1368-
sqlite().verified_stmt("SELECT a >> 1 FROM t");
1369-
1370-
let unsupported = all_dialects_where(|d| !d.supports_bitwise_shift_operators());
1371-
for (sql, token) in [
1372-
("SELECT a << 1 FROM t", "ShiftLeft"),
1373-
("SELECT a >> 1 FROM t", "ShiftRight"),
1374-
] {
1375-
assert_eq!(
1376-
unsupported.parse_sql_statements(sql),
1377-
Err(ParserError::ParserError(format!(
1378-
"No infix parser for token {token}"
1379-
))),
1380-
"{sql}"
1381-
);
1382-
}
1383-
}
1384-
13851365
fn sqlite() -> TestedDialects {
13861366
TestedDialects::new(vec![Box::new(SQLiteDialect {})])
13871367
}
@@ -1544,6 +1524,26 @@ fn parse_bitwise_and_or_share_precedence() {
15441524
}
15451525
}
15461526

1527+
#[test]
1528+
fn parse_bitwise_shift_operators() {
1529+
sqlite().verified_stmt("SELECT a << 1 FROM t");
1530+
sqlite().verified_stmt("SELECT a >> 1 FROM t");
1531+
1532+
let unsupported = all_dialects_where(|d| !d.supports_bitwise_shift_operators());
1533+
for (sql, token) in [
1534+
("SELECT a << 1 FROM t", "ShiftLeft"),
1535+
("SELECT a >> 1 FROM t", "ShiftRight"),
1536+
] {
1537+
assert_eq!(
1538+
unsupported.parse_sql_statements(sql),
1539+
Err(ParserError::ParserError(format!(
1540+
"No infix parser for token {token}"
1541+
))),
1542+
"{sql}"
1543+
);
1544+
}
1545+
}
1546+
15471547
#[test]
15481548
fn parse_left_shift_and_bitwise_and_are_left_associative() {
15491549
assert_eq!(

0 commit comments

Comments
 (0)