示例#1
0
 def index_adjust(self, index, adjustment):
     RunLengthList.index_adjust(self, index, adjustment)
     self.adjustments.append((index, adjustment))
示例#2
0
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()
示例#3
0
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")]
示例#4
0
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()