From 27d2b4b6680ba9e7182709a8f3fd1fe81d9c1039 Mon Sep 17 00:00:00 2001 From: tommyod Date: Tue, 1 Oct 2024 19:45:21 +0200 Subject: [PATCH] nitpick on comments --- tests/test_fenwick.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/test_fenwick.py b/tests/test_fenwick.py index 262f14e..2fb92cc 100644 --- a/tests/test_fenwick.py +++ b/tests/test_fenwick.py @@ -48,16 +48,15 @@ def test_bisect_left(self): # Create a cumulative sum cumsum = list(itertools.accumulate(frequencies)) - test_values = [-5, 0.5, 1, 2, 3, 7] + # Test at some random values, including edge cases + test_values = [-5, 0.5, 1, 2, 3, 7] for test_value in test_values: - # Indexing the FenwickTree index_fenwick = tree.bisect_right(test_value) index_bisect = bisect.bisect_right(cumsum, test_value) self.assertEqual(index_fenwick, index_bisect) - - - # Test a specific edge case. The cumsums are [1, 3, 6], and the + + # Test a specific case. The cumsums are [1, 3, 6], and the # smallest index i such that cumsum[i] > 3 is 2. self.assertEqual(tree.bisect_right(3), 2)