Skip to content

Commit

Permalink
tests: Add regression for v1.13.1 pane spacing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Sep 10, 2022
1 parent 2b75fb2 commit 3f55292
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
session_name: many-windows-issue
windows:
- window_name: moo
layout: main-horizontal
panes:
- echo hello
- echo hello
- echo hello
- echo hello
- echo hello
- echo hello
- echo hello
26 changes: 26 additions & 0 deletions tests/test_workspacebuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1217,3 +1217,29 @@ def is_almost_equal(x, y):

assert is_almost_equal(height(panes[0]), height(panes[1]))
assert is_almost_equal(width(panes[0]), width(panes[1]))


def test_issue_800_default_size_many_windows(server, monkeypatch):
yaml_config = test_utils.read_config_file(
"regressions/issue_800_default_size_many_windows.yaml"
)
sconfig = kaptan.Kaptan(handler="yaml")
sconfig = sconfig.import_config(yaml_config).get()
sconfig = config.expand(sconfig)
sconfig = config.trickle(sconfig)

builder = WorkspaceBuilder(sconf=sconfig, server=server)
builder.build()

assert len(server.list_sessions()) == 1

# Assign an active pane to the session
second_session = server.list_sessions()[0]
first_pane_on_second_session_id = second_session.list_windows()[0].list_panes()[0][
"pane_id"
]
monkeypatch.setenv("TMUX_PANE", first_pane_on_second_session_id)

builder = WorkspaceBuilder(sconf=sconfig, server=server)

assert builder.find_current_attached_session() == second_session

0 comments on commit 3f55292

Please sign in to comment.