diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-09-25 08:20:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-09-25 08:20:09 +0000 |
commit | 4554ab4c7d6b2bbbaa6f4d0b810bf477d1a505a6 (patch) | |
tree | 8f4f60a82ab9cd6dcd41397e4ecb2960c332b209 /tests/test_helper.py | |
parent | Releasing debian version 18.5.1-1. (diff) | |
download | sqlglot-4554ab4c7d6b2bbbaa6f4d0b810bf477d1a505a6.tar.xz sqlglot-4554ab4c7d6b2bbbaa6f4d0b810bf477d1a505a6.zip |
Merging upstream version 18.7.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_helper.py')
-rw-r--r-- | tests/test_helper.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/test_helper.py b/tests/test_helper.py index 7d63c34..a8872e9 100644 --- a/tests/test_helper.py +++ b/tests/test_helper.py @@ -1,7 +1,7 @@ import unittest from sqlglot.dialects import BigQuery, Dialect, Snowflake -from sqlglot.helper import name_sequence, tsort +from sqlglot.helper import merge_ranges, name_sequence, tsort class TestHelper(unittest.TestCase): @@ -66,3 +66,10 @@ class TestHelper(unittest.TestCase): self.assertEqual(s1(), "a2") self.assertEqual(s2(), "b1") self.assertEqual(s2(), "b2") + + def test_merge_ranges(self): + self.assertEqual([], merge_ranges([])) + self.assertEqual([(0, 1)], merge_ranges([(0, 1)])) + self.assertEqual([(0, 1), (2, 3)], merge_ranges([(0, 1), (2, 3)])) + self.assertEqual([(0, 3)], merge_ranges([(0, 1), (1, 3)])) + self.assertEqual([(0, 1), (2, 4)], merge_ranges([(2, 3), (0, 1), (3, 4)])) |