diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-26 08:12:52 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-26 08:12:52 +0000 |
commit | a1f10f8d39404d9bae42a64efaf505fa12f34c1a (patch) | |
tree | 9eb894268f2a145aa9d42b1726a555ab1359810f /tests/test_generator.py | |
parent | Adding upstream version 25.8.1. (diff) | |
download | sqlglot-a1f10f8d39404d9bae42a64efaf505fa12f34c1a.tar.xz sqlglot-a1f10f8d39404d9bae42a64efaf505fa12f34c1a.zip |
Adding upstream version 25.16.1.upstream/25.16.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_generator.py')
-rw-r--r-- | tests/test_generator.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_generator.py b/tests/test_generator.py index a5945b2..e21aa25 100644 --- a/tests/test_generator.py +++ b/tests/test_generator.py @@ -1,3 +1,4 @@ +import time import unittest from sqlglot import exp, parse_one @@ -43,3 +44,10 @@ class TestGenerator(unittest.TestCase): assert parse_one("X").sql(identify="safe") == "X" assert parse_one("x as 1").sql(identify="safe") == '"x" AS "1"' assert parse_one("X as 1").sql(identify="safe") == 'X AS "1"' + + def test_generate_nested_binary(self): + sql = "SELECT 'foo'" + (" || 'foo'" * 500) + + now = time.time() + self.assertEqual(parse_one(sql).sql(), sql) + self.assertLessEqual(time.time() - now, 0.1) |