summaryrefslogtreecommitdiffstats
path: root/tests/test_tokens.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-09-07 11:39:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-09-07 11:39:48 +0000
commitf73e9af131151f1e058446361c35b05c4c90bf10 (patch)
treeed425b89f12d3f5e4709290bdc03d876f365bc97 /tests/test_tokens.py
parentReleasing debian version 17.12.0-1. (diff)
downloadsqlglot-f73e9af131151f1e058446361c35b05c4c90bf10.tar.xz
sqlglot-f73e9af131151f1e058446361c35b05c4c90bf10.zip
Merging upstream version 18.2.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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 = [