summaryrefslogtreecommitdiffstats
path: root/tests/test_helper.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-16 09:41:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-16 09:41:18 +0000
commit67578a7602a5be7eb51f324086c8d49bcf8b7498 (patch)
tree0b7515c922d1c383cea24af5175379cfc8edfd15 /tests/test_helper.py
parentReleasing debian version 15.2.0-1. (diff)
downloadsqlglot-67578a7602a5be7eb51f324086c8d49bcf8b7498.tar.xz
sqlglot-67578a7602a5be7eb51f324086c8d49bcf8b7498.zip
Merging upstream version 16.2.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_helper.py')
-rw-r--r--tests/test_helper.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/tests/test_helper.py b/tests/test_helper.py
index 82d917e..7d63c34 100644
--- a/tests/test_helper.py
+++ b/tests/test_helper.py
@@ -6,17 +6,16 @@ from sqlglot.helper import name_sequence, tsort
class TestHelper(unittest.TestCase):
def test_tsort(self):
- self.assertEqual(tsort({"a": []}), ["a"])
- self.assertEqual(tsort({"a": ["b", "b"]}), ["b", "a"])
- self.assertEqual(tsort({"a": ["b"]}), ["b", "a"])
- self.assertEqual(tsort({"a": ["c"], "b": [], "c": []}), ["c", "a", "b"])
+ self.assertEqual(tsort({"a": set()}), ["a"])
+ self.assertEqual(tsort({"a": {"b"}}), ["b", "a"])
+ self.assertEqual(tsort({"a": {"c"}, "b": set(), "c": set()}), ["b", "c", "a"])
self.assertEqual(
tsort(
{
- "a": ["b", "c"],
- "b": ["c"],
- "c": [],
- "d": ["a"],
+ "a": {"b", "c"},
+ "b": {"c"},
+ "c": set(),
+ "d": {"a"},
}
),
["c", "b", "a", "d"],
@@ -25,9 +24,9 @@ class TestHelper(unittest.TestCase):
with self.assertRaises(ValueError):
tsort(
{
- "a": ["b", "c"],
- "b": ["a"],
- "c": [],
+ "a": {"b", "c"},
+ "b": {"a"},
+ "c": set(),
}
)