summaryrefslogtreecommitdiffstats
path: root/tests/test_tokens.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-09-07 11:39:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-09-07 11:39:43 +0000
commit341eb1a6bdf0dd5b015e5140d3b068c6fd3f4d87 (patch)
tree61fb7eca2238fb5d41d3906f4af41de03abd25ea /tests/test_tokens.py
parentAdding upstream version 17.12.0. (diff)
downloadsqlglot-341eb1a6bdf0dd5b015e5140d3b068c6fd3f4d87.tar.xz
sqlglot-341eb1a6bdf0dd5b015e5140d3b068c6fd3f4d87.zip
Adding upstream version 18.2.0.upstream/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 = [