File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -330,6 +330,37 @@ def test_new_window_with_environment_logs_warning_for_old_tmux(
330330 ), "Warning missing"
331331
332332
333+ @pytest .mark .skipif (
334+ has_lt_version ("3.2" ),
335+ reason = "Only 3.2+ has the -a and -b flag on new-window" ,
336+ )
337+ def test_session_new_window_with_direction (
338+ session : Session ,
339+ ) -> None :
340+ """Verify new window with direction."""
341+ window = session .active_window
342+ window .refresh ()
343+
344+ window_initial = session .new_window (window_name = "Example" )
345+ assert window_initial .window_index == "2"
346+
347+ window_before = session .new_window (
348+ window_name = "Window before" , direction = WindowDirection .Before
349+ )
350+ window_initial .refresh ()
351+ assert window_before .window_index == "1"
352+ assert window_initial .window_index == "3"
353+
354+ window_after = session .new_window (
355+ window_name = "Window after" , direction = WindowDirection .After
356+ )
357+ window_initial .refresh ()
358+ window_after .refresh ()
359+ assert window_after .window_index == "3"
360+ assert window_initial .window_index == "4"
361+ assert window_before .window_index == "1"
362+
363+
333364@pytest .mark .skipif (
334365 has_gte_version ("3.1" ),
335366 reason = "Only 3.1 has the -a and -b flag on new-window" ,
You can’t perform that action at this time.
0 commit comments