|
@@ -25,3 +25,12 @@ def test_eq():
|
|
|
assert not _PolygonalCircuit((0, 1, 2)) == _PolygonalCircuit((0, 1, 4))
|
|
|
assert not _PolygonalCircuit((0, 1, 2)) == _PolygonalCircuit((0, 4, 2))
|
|
|
assert not _PolygonalCircuit((0, 1, 2)) == _PolygonalCircuit((4, 1, 2))
|
|
|
+
|
|
|
+
|
|
|
+def test_hash():
|
|
|
+ assert hash(_PolygonalCircuit((0, 1, 2))) == hash(_PolygonalCircuit((0, 1, 2)))
|
|
|
+ assert hash(_PolygonalCircuit((0, 1, 2))) == hash(_PolygonalCircuit((1, 2, 0)))
|
|
|
+ assert hash(_PolygonalCircuit((0, 1, 2))) == hash(_PolygonalCircuit((2, 0, 1)))
|
|
|
+ assert hash(_PolygonalCircuit((0, 1, 2))) != hash(_PolygonalCircuit((0, 1, 4)))
|
|
|
+ assert hash(_PolygonalCircuit((0, 1, 2))) != hash(_PolygonalCircuit((0, 4, 2)))
|
|
|
+ assert hash(_PolygonalCircuit((0, 1, 2))) != hash(_PolygonalCircuit((4, 1, 2)))
|