summaryrefslogtreecommitdiffstats
path: root/tests/test_generator.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_generator.py')
-rw-r--r--tests/test_generator.py8
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)