Some matching cleanup and move a utility function out

This commit is contained in:
Marc Di Luzio 2024-08-16 23:28:07 +01:00
parent 964e1c8f84
commit e8ff102e33
4 changed files with 22 additions and 33 deletions

View file

@ -405,14 +405,3 @@ def test_auth_scopes():
# Validate the state by constucting a new one
_ = state.State(tmp_state._dict)
def test_iterate_all_shifts():
original = [1, 2, 3, 4]
lists = [val for val in matching.iterate_all_shifts(original)]
assert lists == [
[1, 2, 3, 4],
[2, 3, 4, 1],
[3, 4, 1, 2],
[4, 1, 2, 3],
]

12
tests/util_test.py Normal file
View file

@ -0,0 +1,12 @@
import matchy.util as util
def test_iterate_all_shifts():
original = [1, 2, 3, 4]
lists = [val for val in util.iterate_all_shifts(original)]
assert lists == [
[1, 2, 3, 4],
[2, 3, 4, 1],
[3, 4, 1, 2],
[4, 1, 2, 3],
]