def test_empty_Rle(self): assert Rle().length() == 0
def test_add_to_empty_rle(self): assert Rle().add(1, 3) == Rle([1], [3])
def test_add_implicit_multiplicity(self): assert Rle([3, 4], [2, 3]).add(1) == Rle([3, 4, 1], [2, 3, 1])
def test_add_same_as_last(self): assert Rle([3, 4]).add(4, 7) == Rle([3, 4], [1, 8])
def test_negative_multiplicity(self): with pytest.raises(AssertionError): Rle([1, 2, 3]).add(1, -5)
def test_example(self): assert Rle([1, 1, 3, 4], [2, 3, 1, 2]).nrun() == 3
def test_add_different_then_last(self): assert Rle([3, 4]).add(5, 2) == Rle([3, 4, 5], [1, 1, 2])
def test_example(self): assert Rle([1, 1, 3, 4], [2, 3, 1, 2]).decode() == [1, 1, 1, 1, 1, 3, 4, 4]
def test_empty_Rle(self): assert Rle().end() == []
def test_example(self): assert Rle([1, 1, 3, 4], [2, 3, 1, 2]).run_value() == [1, 3, 4]
def test_empty_Rle(self): assert Rle().decode() == []
def test_empty_Rle(self): assert Rle().run_value() == []
def test_example(self): assert Rle([1, 1, 3, 4], [2, 3, 1, 2]).start() == [1, 6, 7]
def test_empty_Rle(self): assert Rle().start() == []
def test_empty_Rle(self): assert Rle().run_length() == []
def test_example(self): assert Rle([1, 1, 3, 4], [2, 3, 1, 2]).end() == [5, 6, 8]
def test_example(self): assert Rle([1, 1, 3, 4], [2, 3, 1, 2]).run_length() == [5, 1, 2]
def test_empty_Rle(self): assert Rle().nrun() == 0