summaryrefslogtreecommitdiffstats
path: root/tests/test_expressions.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-10-22 17:00:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-10-22 17:00:19 +0000
commit357f4c323239b9ba9b604c444fe3c2e1991e46ec (patch)
tree739aa7ddca96a60c9148554b35bb1b231cb9888f /tests/test_expressions.py
parentReleasing debian version 25.24.5-1. (diff)
downloadsqlglot-357f4c323239b9ba9b604c444fe3c2e1991e46ec.tar.xz
sqlglot-357f4c323239b9ba9b604c444fe3c2e1991e46ec.zip
Merging upstream version 25.26.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_expressions.py')
-rw-r--r--tests/test_expressions.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/test_expressions.py b/tests/test_expressions.py
index 1c88952..8ff117a 100644
--- a/tests/test_expressions.py
+++ b/tests/test_expressions.py
@@ -935,15 +935,13 @@ FROM foo""",
def test_to_interval(self):
self.assertEqual(exp.to_interval("1day").sql(), "INTERVAL '1' DAY")
self.assertEqual(exp.to_interval(" 5 months").sql(), "INTERVAL '5' MONTHS")
- with self.assertRaises(ValueError):
- exp.to_interval("bla")
+ self.assertEqual(exp.to_interval("-2 day").sql(), "INTERVAL '-2' DAY")
self.assertEqual(exp.to_interval(exp.Literal.string("1day")).sql(), "INTERVAL '1' DAY")
+ self.assertEqual(exp.to_interval(exp.Literal.string("-2 day")).sql(), "INTERVAL '-2' DAY")
self.assertEqual(
exp.to_interval(exp.Literal.string(" 5 months")).sql(), "INTERVAL '5' MONTHS"
)
- with self.assertRaises(ValueError):
- exp.to_interval(exp.Literal.string("bla"))
def test_to_table(self):
table_only = exp.to_table("table_name")