summaryrefslogtreecommitdiffstats
path: root/tests/test_tokens.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_tokens.py')
-rw-r--r--tests/test_tokens.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_tokens.py b/tests/test_tokens.py
index f3343e7..f4d3858 100644
--- a/tests/test_tokens.py
+++ b/tests/test_tokens.py
@@ -6,6 +6,18 @@ from sqlglot.tokens import Tokenizer, TokenType
class TestTokens(unittest.TestCase):
+ def test_space_keywords(self):
+ for string, length in (
+ ("group bys", 2),
+ (" group bys", 2),
+ (" group bys ", 2),
+ ("group by)", 2),
+ ("group bys)", 3),
+ ):
+ tokens = Tokenizer().tokenize(string)
+ self.assertTrue("GROUP" in tokens[0].text.upper())
+ self.assertEqual(len(tokens), length)
+
def test_comment_attachment(self):
tokenizer = Tokenizer()
sql_comment = [