Improve regex

This commit is contained in:
Beto Dealmeida
2025-07-31 11:38:14 -04:00
parent b07a12a538
commit b36dafc819
2 changed files with 12 additions and 4 deletions

View File

@@ -1309,9 +1309,13 @@ def test_sanitize_clause_multiple():
def test_sqlparse_issue_652():
stmt = sqlparse.parse(r"SELECT 'Don\'t stop' FROM table")[0]
assert len(stmt.tokens) == 7
assert str(stmt.tokens[2]) == r"'Don\'t stop'"
stmt = sqlparse.parse(r"foo = '\' AND bar = 'baz'")[0]
assert len(stmt.tokens) == 5
assert str(stmt.tokens[0]) == "foo = '\\'"
assert str(stmt.tokens[0]) == r"foo = '\'"
@pytest.mark.parametrize(