File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 3232version_regex = re .compile (r"([0-9]\.[0-9])|(master)" )
3333
3434
35+ def _get_next_tmux_version () -> str :
36+ """Derive next tmux version from TMUX_MAX_VERSION.
37+
38+ Strips trailing letters and increments minor version.
39+ E.g., "3.5a" -> "3.6"
40+ """
41+ base = re .sub (r"[a-z]+$" , "" , TMUX_MAX_VERSION )
42+ major , minor = base .split ("." )
43+ return f"{ major } .{ int (minor ) + 1 } "
44+
45+
3546def test_has_version () -> None :
3647 """Test has_version()."""
3748 assert has_version (str (get_version ()))
@@ -298,10 +309,10 @@ class VersionParsingFixture(t.NamedTuple):
298309 ),
299310 VersionParsingFixture (
300311 test_id = "next_version" ,
301- mock_stdout = ["tmux next-3.6 " ],
312+ mock_stdout = [f "tmux next-{ _get_next_tmux_version () } " ],
302313 mock_stderr = None ,
303314 mock_platform = None ,
304- expected_version = "3.6" ,
315+ expected_version = _get_next_tmux_version () ,
305316 raises = False ,
306317 exc_msg_regex = None ,
307318 ),
You can’t perform that action at this time.
0 commit comments