|
5 | 5 |
|
6 | 6 | import pytest
|
7 | 7 |
|
8 |
| -from libtmux.common import has_gte_version, has_lt_version |
| 8 | +from libtmux.common import has_gte_version, has_lt_version, has_lte_version |
9 | 9 | from libtmux.constants import PaneDirection, ResizeAdjustmentDirection
|
10 | 10 | from libtmux.session import Session
|
11 | 11 |
|
@@ -133,6 +133,36 @@ def test_capture_pane_end(session: Session) -> None:
|
133 | 133 | assert pane_contents == '$ printf "%s"\n$'
|
134 | 134 |
|
135 | 135 |
|
| 136 | +@pytest.mark.skipif( |
| 137 | + has_lte_version("3.1"), |
| 138 | + reason="3.2 has the -Z flag on split-window", |
| 139 | +) |
| 140 | +def test_pane_split_window_zoom( |
| 141 | + session: Session, |
| 142 | +) -> None: |
| 143 | + """Verify splitting window with zoom.""" |
| 144 | + window_without_zoom = session.new_window(window_name="split_without_zoom") |
| 145 | + initial_pane_without_zoom = window_without_zoom.active_pane |
| 146 | + assert initial_pane_without_zoom is not None |
| 147 | + window_with_zoom = session.new_window(window_name="split_with_zoom") |
| 148 | + initial_pane_with_zoom = window_with_zoom.active_pane |
| 149 | + assert initial_pane_with_zoom is not None |
| 150 | + pane_without_zoom = initial_pane_without_zoom.split( |
| 151 | + zoom=False, |
| 152 | + ) |
| 153 | + pane_with_zoom = initial_pane_with_zoom.split( |
| 154 | + zoom=True, |
| 155 | + ) |
| 156 | + |
| 157 | + assert pane_without_zoom.width == pane_without_zoom.window_width |
| 158 | + assert pane_without_zoom.height is not None |
| 159 | + assert pane_without_zoom.window_height is not None |
| 160 | + assert pane_without_zoom.height < pane_without_zoom.window_height |
| 161 | + |
| 162 | + assert pane_with_zoom.width == pane_with_zoom.window_width |
| 163 | + assert pane_with_zoom.height == pane_with_zoom.window_height |
| 164 | + |
| 165 | + |
136 | 166 | @pytest.mark.skipif(
|
137 | 167 | has_lt_version("2.9"),
|
138 | 168 | reason="resize-window only exists in tmux 2.9+",
|
|
0 commit comments