summaryrefslogtreecommitdiffstats
path: root/tests/test_tokens.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-27 10:46:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-27 10:46:33 +0000
commitaa1d1f1ea72887a3efb78f4950e27bc79dfa3766 (patch)
treea9f5bf5ab14c69d011e21d40f8504c4f94a8de72 /tests/test_tokens.py
parentAdding upstream version 11.2.0. (diff)
downloadsqlglot-aa1d1f1ea72887a3efb78f4950e27bc79dfa3766.tar.xz
sqlglot-aa1d1f1ea72887a3efb78f4950e27bc79dfa3766.zip
Adding upstream version 11.2.3.upstream/11.2.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_tokens.py')
-rw-r--r--tests/test_tokens.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_tokens.py b/tests/test_tokens.py
index d30c445..0888555 100644
--- a/tests/test_tokens.py
+++ b/tests/test_tokens.py
@@ -18,6 +18,18 @@ class TestTokens(unittest.TestCase):
for sql, comment in sql_comment:
self.assertEqual(tokenizer.tokenize(sql)[0].comments, comment)
+ def test_token_line(self):
+ tokens = Tokenizer().tokenize(
+ """SELECT /*
+ line break
+ */
+ 'x
+ y',
+ x"""
+ )
+
+ self.assertEqual(tokens[-1].line, 6)
+
def test_jinja(self):
tokenizer = Tokenizer()
@@ -26,6 +38,7 @@ class TestTokens(unittest.TestCase):
SELECT
{{ x }},
{{- x -}},
+ {# it's a comment #}
{% for x in y -%}
a {{+ b }}
{% endfor %};