summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_tsql.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/dialects/test_tsql.py')
-rw-r--r--tests/dialects/test_tsql.py22
1 files changed, 8 insertions, 14 deletions
diff --git a/tests/dialects/test_tsql.py b/tests/dialects/test_tsql.py
index c8c0d82..e2ec15b 100644
--- a/tests/dialects/test_tsql.py
+++ b/tests/dialects/test_tsql.py
@@ -29,6 +29,14 @@ class TestTSQL(Validator):
self.validate_identity("CAST(x AS int) OR y", "CAST(x AS INTEGER) <> 0 OR y <> 0")
self.validate_all(
+ "SELECT IIF(cond <> 0, 'True', 'False')",
+ read={
+ "spark": "SELECT IF(cond, 'True', 'False')",
+ "sqlite": "SELECT IIF(cond, 'True', 'False')",
+ "tsql": "SELECT IIF(cond <> 0, 'True', 'False')",
+ },
+ )
+ self.validate_all(
"SELECT TRIM(BOTH 'a' FROM a)",
read={
"mysql": "SELECT TRIM(BOTH 'a' FROM a)",
@@ -1302,20 +1310,6 @@ WHERE
},
)
- def test_iif(self):
- self.validate_identity(
- "SELECT IF(cond, 'True', 'False')", "SELECT IIF(cond <> 0, 'True', 'False')"
- )
- self.validate_identity(
- "SELECT IIF(cond, 'True', 'False')", "SELECT IIF(cond <> 0, 'True', 'False')"
- )
- self.validate_all(
- "SELECT IIF(cond, 'True', 'False');",
- write={
- "spark": "SELECT IF(cond, 'True', 'False')",
- },
- )
-
def test_lateral_subquery(self):
self.validate_all(
"SELECT x.a, x.b, t.v, t.y FROM x CROSS APPLY (SELECT v, y FROM t) t(v, y)",