summaryrefslogtreecommitdiffstats
path: root/tests/test_transpile.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-23 08:42:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-23 08:42:55 +0000
commitade4a78e8fabcaa7270b6d4be2187457a3fa115f (patch)
tree018225e76010479b3a568bb6d9ef5df457802885 /tests/test_transpile.py
parentAdding upstream version 10.5.2. (diff)
downloadsqlglot-ade4a78e8fabcaa7270b6d4be2187457a3fa115f.tar.xz
sqlglot-ade4a78e8fabcaa7270b6d4be2187457a3fa115f.zip
Adding upstream version 10.5.6.upstream/10.5.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_transpile.py')
-rw-r--r--tests/test_transpile.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_transpile.py b/tests/test_transpile.py
index 3a7fea4..3e094f5 100644
--- a/tests/test_transpile.py
+++ b/tests/test_transpile.py
@@ -272,6 +272,11 @@ FROM bar /* comment 5 */, tbl /* comment 6 */""",
"WITH A(filter) AS (VALUES 1, 2, 3) SELECT * FROM A WHERE filter >= 2",
"WITH A(filter) AS (VALUES (1), (2), (3)) SELECT * FROM A WHERE filter >= 2",
)
+ self.validate(
+ "SELECT BOOL_OR(a > 10) FROM (VALUES 1, 2, 15) AS T(a)",
+ "SELECT BOOL_OR(a > 10) FROM (VALUES (1), (2), (15)) AS T(a)",
+ write="presto",
+ )
def test_alter(self):
self.validate(
@@ -447,6 +452,9 @@ FROM bar /* comment 5 */, tbl /* comment 6 */""",
self.assertEqual(generated, pretty)
self.assertEqual(parse_one(sql), parse_one(pretty))
+ def test_pretty_line_breaks(self):
+ self.assertEqual(transpile("SELECT '1\n2'", pretty=True)[0], "SELECT\n '1\n2'")
+
@mock.patch("sqlglot.parser.logger")
def test_error_level(self, logger):
invalid = "x + 1. ("