summaryrefslogtreecommitdiff
path: root/tests/test_tokenize.py
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2016-09-26 13:03:42 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2016-09-26 13:03:42 +0200
commitee2cbfea194fac4f2bbfe526fe2c3bdb856aed0b (patch)
tree9f88e39f29c47093c558466c8a9e2193c4f7ec84 /tests/test_tokenize.py
parente413b7867b8599fac2d4e9f6bb19a668fecb7e02 (diff)
downloadsqlparse-ee2cbfea194fac4f2bbfe526fe2c3bdb856aed0b.tar.gz
Fix parsing of UNION ALL (fixes #294).
Diffstat (limited to 'tests/test_tokenize.py')
-rw-r--r--tests/test_tokenize.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_tokenize.py b/tests/test_tokenize.py
index 22cb90f..b548541 100644
--- a/tests/test_tokenize.py
+++ b/tests/test_tokenize.py
@@ -157,6 +157,12 @@ def test_parse_join(expr):
assert p.tokens[0].ttype is T.Keyword
+def test_parse_union(): # issue294
+ p = sqlparse.parse('UNION ALL')[0]
+ assert len(p.tokens) == 1
+ assert p.tokens[0].ttype is T.Keyword
+
+
@pytest.mark.parametrize('s', ['END IF', 'END IF', 'END\t\nIF',
'END LOOP', 'END LOOP', 'END\t\nLOOP'])
def test_parse_endifloop(s):