DAGSet on DAGSet tests
This commit is contained in:
@@ -137,7 +137,6 @@ class TestDAGSetCallbacks:
|
|||||||
assert 3 in removed
|
assert 3 in removed
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TestDAGSetInPlaceOperators:
|
class TestDAGSetInPlaceOperators:
|
||||||
"""Test in-place set operators."""
|
"""Test in-place set operators."""
|
||||||
|
|
||||||
@@ -157,6 +156,12 @@ class TestDAGSetInPlaceOperators:
|
|||||||
s |= "xyz"
|
s |= "xyz"
|
||||||
assert "xyz" in s
|
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:
|
class TestIAdd:
|
||||||
def test_set(self) -> None:
|
def test_set(self) -> None:
|
||||||
s = DAGSetView({1, 2})
|
s = DAGSetView({1, 2})
|
||||||
@@ -173,6 +178,12 @@ class TestDAGSetInPlaceOperators:
|
|||||||
s += "b"
|
s += "b"
|
||||||
assert "b" in s
|
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:
|
class TestISub:
|
||||||
def test_set(self) -> None:
|
def test_set(self) -> None:
|
||||||
s = DAGSetView({1, 2, 3, 4})
|
s = DAGSetView({1, 2, 3, 4})
|
||||||
@@ -189,6 +200,12 @@ class TestDAGSetInPlaceOperators:
|
|||||||
s -= "b"
|
s -= "b"
|
||||||
assert set(s) == {"a", "c"}
|
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:
|
class TestIAnd:
|
||||||
def test_set(self) -> None:
|
def test_set(self) -> None:
|
||||||
s = DAGSetView({1, 2, 3})
|
s = DAGSetView({1, 2, 3})
|
||||||
@@ -200,6 +217,12 @@ class TestDAGSetInPlaceOperators:
|
|||||||
s &= [2, 3]
|
s &= [2, 3]
|
||||||
assert set(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:
|
class TestIXor:
|
||||||
def test_set(self) -> None:
|
def test_set(self) -> None:
|
||||||
s = DAGSetView({1, 2, 3})
|
s = DAGSetView({1, 2, 3})
|
||||||
@@ -210,3 +233,9 @@ class TestDAGSetInPlaceOperators:
|
|||||||
s = DAGSetView({1, 2})
|
s = DAGSetView({1, 2})
|
||||||
s ^= [2, 3]
|
s ^= [2, 3]
|
||||||
assert set(s) == {1, 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}
|
||||||
|
|||||||
Reference in New Issue
Block a user