DAGSet on DAGSet tests

This commit is contained in:
John Lancaster
2026-02-21 10:21:45 -06:00
parent 4b568d7fa5
commit 7a9a72775e

View File

@@ -137,7 +137,6 @@ class TestDAGSetCallbacks:
assert 3 in removed
class TestDAGSetInPlaceOperators:
"""Test in-place set operators."""
@@ -157,6 +156,12 @@ class TestDAGSetInPlaceOperators:
s |= "xyz"
assert "xyz" in s
def test_dagset(self) -> None:
s = DAGSetView({1, 2})
other = DAGSetView({3, 4})
s |= other
assert set(s) == {1, 2, 3, 4}
class TestIAdd:
def test_set(self) -> None:
s = DAGSetView({1, 2})
@@ -173,6 +178,12 @@ class TestDAGSetInPlaceOperators:
s += "b"
assert "b" in s
def test_dagset(self) -> None:
s = DAGSetView({1, 2})
other = DAGSetView({3, 4})
s += other
assert set(s) == {1, 2, 3, 4}
class TestISub:
def test_set(self) -> None:
s = DAGSetView({1, 2, 3, 4})
@@ -189,6 +200,12 @@ class TestDAGSetInPlaceOperators:
s -= "b"
assert set(s) == {"a", "c"}
def test_dagset(self) -> None:
s = DAGSetView({1, 2, 3, 4})
other = DAGSetView({2, 3})
s -= other
assert set(s) == {1, 4}
class TestIAnd:
def test_set(self) -> None:
s = DAGSetView({1, 2, 3})
@@ -200,6 +217,12 @@ class TestDAGSetInPlaceOperators:
s &= [2, 3]
assert set(s) == {2, 3}
def test_dagset(self) -> None:
s = DAGSetView({1, 2, 3})
other = DAGSetView({2, 3, 4})
s &= other
assert set(s) == {2, 3}
class TestIXor:
def test_set(self) -> None:
s = DAGSetView({1, 2, 3})
@@ -210,3 +233,9 @@ class TestDAGSetInPlaceOperators:
s = DAGSetView({1, 2})
s ^= [2, 3]
assert set(s) == {1, 3}
def test_dagset(self) -> None:
s = DAGSetView({1, 2, 3})
other = DAGSetView({3, 4, 5})
s ^= other
assert set(s) == {1, 2, 4, 5}