diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-03-19 10:22:04 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-03-19 10:22:04 +0000 |
commit | 57c3067868d0a1da90ec0f2201dd91f031241274 (patch) | |
tree | 3b16819683e27ccbc7e7726675ab8d3e978fc8aa /tests/test_tokens.py | |
parent | Adding upstream version 11.3.6. (diff) | |
download | sqlglot-57c3067868d0a1da90ec0f2201dd91f031241274.tar.xz sqlglot-57c3067868d0a1da90ec0f2201dd91f031241274.zip |
Adding upstream version 11.4.1.upstream/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.py | 15 |
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() |