def test_lens_call_mut_shallow(): state = [object(), object()] result = lens.call_mut("append", object(), shallow=True)(state) assert result[0] is state[0]
def test_lens_call_mut_deep(): state = [object(), object()] result = lens.call_mut("append", object())(state) assert result[0] is not state[0]
def test_lens_call_mut_kwargs(): result = lens.call_mut("sort", key=len)(["eine", "un", "one"]) assert result == ["un", "one", "eine"]
def test_lens_call_mut_args(): assert lens.call_mut("append", 3)([1, 2]) == [1, 2, 3]
def test_lens_call_mut(): assert lens.call_mut("sort")([3, 1, 2]) == [1, 2, 3]
def test_lens_call_mut_kwargs(): result = lens.call_mut('sort', key=len)(['eine', 'un', 'one']) assert result == ['un', 'one', 'eine']