From 4620260e43a3da24e0a04602eda244726df84641 Mon Sep 17 00:00:00 2001 From: beam Date: Fri, 30 Oct 2026 07:11:14 +0000 Subject: [PATCH] beam: fix rotated_binary_search test pivot expectation (left-rotation semantics) --- wizard-work/beam/test_rotated_binary_search.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wizard-work/beam/test_rotated_binary_search.py b/wizard-work/beam/test_rotated_binary_search.py index 39d6fb3..ea921c4 100644 --- a/wizard-work/beam/test_rotated_binary_search.py +++ b/wizard-work/beam/test_rotated_binary_search.py @@ -24,8 +24,9 @@ def test_rotated(): base = [1,2,3,4,5,6,7] for r in range(len(base)): arr = base[r:] + base[:r] - assert find_pivot(arr) == r, (r, find_pivot(arr)) - assert count_rotations(arr) == r + expected_pivot = (len(base) - r) % len(base) + assert find_pivot(arr) == expected_pivot, (r, find_pivot(arr), expected_pivot) + assert count_rotations(arr) == expected_pivot for t in base: i = search(arr, t) assert i != -1 and arr[i] == t