Skip to content

Commit c825acf

Browse files
committed
test(empty_window): Assert empty window name passed
1 parent 50164f5 commit c825acf

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/test_window.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import pytest
66

77
from libtmux import exc
8-
from libtmux.common import has_gte_version
8+
from libtmux.common import has_gte_version, has_lt_version
99
from libtmux.pane import Pane
1010
from libtmux.server import Server
1111
from libtmux.session import Session
@@ -292,9 +292,21 @@ def test_select_layout_accepts_no_arg(server: Server, session: Session) -> None:
292292
window.select_layout()
293293

294294

295+
@pytest.mark.skipif(
296+
has_lt_version("3.2"), reason="needs filter introduced in tmux >= 3.2"
297+
)
295298
def test_empty_window_name(session: Session) -> None:
296299
session.set_option("automatic-rename", "off")
297300
window = session.new_window(window_name="''", attach=True)
298301

299302
assert window == session.attached_window
300303
assert window.get("window_name") == "''"
304+
305+
cmd = session.cmd(
306+
"list-windows",
307+
"-F",
308+
"#{window_name}",
309+
"-f",
310+
"#{==:#{session_name}," + session.name + "}",
311+
)
312+
assert "''" in cmd.stdout

0 commit comments

Comments
 (0)