def test_file_edit_observation_context_lines():
    """Test diff visualization with different context line settings."""
    obs = FileEditObservation(
        path='/test/file.txt',
        prev_exist=True,
        old_content='Line 1\nLine 2\nLine 3\nLine 4\nLine 5\n',
        new_content='Line 1\nNew Line 2\nLine 3\nNew Line 4\nLine 5\n',
        impl_source=FileEditSource.LLM_BASED_EDIT,
        content='Line 1\nLine 2\nLine 3\nLine 4\nLine 5\n',  # Initial content is old_content
    )

    # Test with 0 context lines
    groups_0 = obs.get_edit_groups(n_context_lines=0)
    # Test with 2 context lines
    groups_2 = obs.get_edit_groups(n_context_lines=2)

    # More context should mean more lines in the groups
    total_lines_0 = sum(
        len(g['before_edits']) + len(g['after_edits']) for g in groups_0
    )
    total_lines_2 = sum(
        len(g['before_edits']) + len(g['after_edits']) for g in groups_2
    )
    assert total_lines_2 > total_lines_0
Test diff visualization with different context line settings.
tests/unit/test_file_edit_observation.py