2023-08-20 11:41:07 +00:00
|
|
|
from pigeon_magnet_solver.helpers import (_fix_exes, _rotate_r, _valid_rotate,
|
|
|
|
rotate_r)
|
2023-08-18 22:34:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_rotate_r():
|
2023-08-20 11:41:07 +00:00
|
|
|
assert _rotate_r(list("1x01")) == list("11x0")
|
|
|
|
assert _rotate_r(list("11x0")) == list("011x")
|
|
|
|
assert _rotate_r(list("011x")) == list("x011")
|
|
|
|
assert _rotate_r(list("x011")) == list("1x01")
|
2023-08-18 22:34:02 +00:00
|
|
|
|
2023-08-20 11:41:07 +00:00
|
|
|
assert _valid_rotate(list("1x01"), list("11x0")) is False
|
|
|
|
assert _valid_rotate(list("1x01"), list("011x")) is False
|
|
|
|
assert _valid_rotate(list("1x01"), list("x011")) is True
|
|
|
|
assert _valid_rotate(list("1x01"), list("1x01")) is True
|
2023-08-18 22:34:02 +00:00
|
|
|
|
2023-08-20 11:41:07 +00:00
|
|
|
assert _fix_exes(list("1x01"), list("x011")) == list("0x11")
|
2023-08-18 22:34:02 +00:00
|
|
|
|
2023-08-20 11:41:07 +00:00
|
|
|
assert rotate_r(list("1x01")) == list("0x11")
|