def index_adjust(self, index, adjustment): RunLengthList.index_adjust(self, index, adjustment) self.adjustments.append((index, adjustment))
def test_RunLengthList_index_adjust_index_collision(): c = RunLengthList([(0, 1), (3, 2)]) c.index_adjust(3, 2) assert c.items() == [(0, 1), (5, 2)], c.items()
def test_RunlengthList_index_adjust_negative_adjustment_normalises(): c = RunLengthList([(0, "f"), (2, "o"), (3, "b")]) c.index_adjust(1, -2) assert c.items() == [(0, "f"), (1, "b")]
def test_RunLengthList_index_adjust(): c = RunLengthList([(0, 1), (3, 2), (6, 3)]) c.index_adjust(2, 2) assert c.items() == [(0, 1), (5, 2), (8, 3)], c.items()