summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAki Ariga <chezou+github@gmail.com>2022-05-03 20:27:17 -0700
committerAndi Albrecht <albrecht.andi@gmail.com>2022-08-08 10:39:55 +0200
commit36687995cfd8d2f674c31f967512a6b17858ca0f (patch)
tree8ad59285fb95dd7760ee9d9676344f62815cd341 /tests
parent049634a6e6d4d06483f85866d300263672ff68bf (diff)
downloadsqlparse-36687995cfd8d2f674c31f967512a6b17858ca0f.tar.gz
DIV is Operator
Diffstat (limited to 'tests')
-rw-r--r--tests/test_parse.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_parse.py b/tests/test_parse.py
index 513b4be..caba537 100644
--- a/tests/test_parse.py
+++ b/tests/test_parse.py
@@ -132,6 +132,12 @@ def test_parse_nested_function():
assert type(t[0]) is sql.Function
+def test_parse_div_operator():
+ p = sqlparse.parse('col1 DIV 5 AS div_col1')[0].tokens
+ assert p[0].tokens[0].tokens[2].ttype is T.Operator
+ assert p[0].get_alias() == 'div_col1'
+
+
def test_quoted_identifier():
t = sqlparse.parse('select x.y as "z" from foo')[0].tokens
assert isinstance(t[2], sql.Identifier)