summaryrefslogtreecommitdiffstats
path: root/tests/test_tokens.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-19 10:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-19 10:22:09 +0000
commit66af5c6fc22f6f11e9ea807b274e011a6f64efb7 (patch)
tree08ceed3b311b7b343935c1e55941b9d15e6f56d8 /tests/test_tokens.py
parentReleasing debian version 11.3.6-1. (diff)
downloadsqlglot-66af5c6fc22f6f11e9ea807b274e011a6f64efb7.tar.xz
sqlglot-66af5c6fc22f6f11e9ea807b274e011a6f64efb7.zip
Merging upstream version 11.4.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_tokens.py')
-rw-r--r--tests/test_tokens.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_tokens.py b/tests/test_tokens.py
index 0888555..909eb18 100644
--- a/tests/test_tokens.py
+++ b/tests/test_tokens.py
@@ -30,6 +30,21 @@ class TestTokens(unittest.TestCase):
self.assertEqual(tokens[-1].line, 6)
+ def test_command(self):
+ tokens = Tokenizer().tokenize("SHOW;")
+ self.assertEqual(tokens[0].token_type, TokenType.SHOW)
+ self.assertEqual(tokens[1].token_type, TokenType.SEMICOLON)
+
+ tokens = Tokenizer().tokenize("EXECUTE")
+ self.assertEqual(tokens[0].token_type, TokenType.EXECUTE)
+ self.assertEqual(len(tokens), 1)
+
+ tokens = Tokenizer().tokenize("FETCH;SHOW;")
+ self.assertEqual(tokens[0].token_type, TokenType.FETCH)
+ self.assertEqual(tokens[1].token_type, TokenType.SEMICOLON)
+ self.assertEqual(tokens[2].token_type, TokenType.SHOW)
+ self.assertEqual(tokens[3].token_type, TokenType.SEMICOLON)
+
def test_jinja(self):
tokenizer = Tokenizer()