summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_trino.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 16:12:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 16:12:58 +0000
commit042432fc9a1f7c3d5d552f12449fe45109fbcd57 (patch)
tree227afb41878f15dba7350b90ec6cfd52a02aabd6 /tests/dialects/test_trino.py
parentAdding upstream version 23.12.1. (diff)
downloadsqlglot-042432fc9a1f7c3d5d552f12449fe45109fbcd57.tar.xz
sqlglot-042432fc9a1f7c3d5d552f12449fe45109fbcd57.zip
Adding upstream version 23.13.1.upstream/23.13.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_trino.py')
-rw-r--r--tests/dialects/test_trino.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/dialects/test_trino.py b/tests/dialects/test_trino.py
new file mode 100644
index 0000000..ccc1407
--- /dev/null
+++ b/tests/dialects/test_trino.py
@@ -0,0 +1,18 @@
+from tests.dialects.test_dialect import Validator
+
+
+class TestTrino(Validator):
+ dialect = "trino"
+
+ def test_trim(self):
+ self.validate_identity("SELECT TRIM('!' FROM '!foo!')")
+ self.validate_identity("SELECT TRIM(BOTH '$' FROM '$var$')")
+ self.validate_identity("SELECT TRIM(TRAILING 'ER' FROM UPPER('worker'))")
+ self.validate_identity(
+ "SELECT TRIM(LEADING FROM ' abcd')",
+ "SELECT LTRIM(' abcd')",
+ )
+ self.validate_identity(
+ "SELECT TRIM('!foo!', '!')",
+ "SELECT TRIM('!' FROM '!foo!')",
+ )