Skip to content

Commit 1a579e2

Browse files
committed
fix(tests): handle bold→bright conversion in complex style test
tmux <3.2 normalizes 'bold' to 'bright' in style output. Added version guard to expect correct output format. Verification method: - Created git worktrees for tmux versions 3.0a, 3.1b, 3.2a, 3.3a, 3.4, 3.5 - Examined source code to trace style handling across versions - Tested directly with tmux commands to verify actual behavior In tmux ≤3.1, styles are parsed and normalized when stored: - attributes_fromstring() accepts both "bold" and "bright" as aliases - attributes_tostring() always outputs "bright" (never "bold") References: - tmux-3.0a/attributes.c:32-50 (attributes_fromstring table) - tmux-3.0a/attributes.c:26-28 (attributes_tostring output) - tmux-3.0a/options.c:126-127 (OPTIONS_IS_STYLE → style_tostring) - tmux commit f03b6113 (tmux 3.2 style format change)
1 parent 48c7b3a commit 1a579e2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/test_options.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,12 @@ def test_style_option_validation(server: Server) -> None:
605605
)
606606
style = session.show_option("status-style")
607607
assert isinstance(style, str)
608-
assert style == "fg=colour240,bg=#525252,bold,underscore"
608+
if has_gte_version("3.2"):
609+
# tmux 3.2+: literal string output
610+
assert style == "fg=colour240,bg=#525252,bold,underscore"
611+
else:
612+
# tmux <3.2: bold→bright
613+
assert style == "fg=colour240,bg=#525252,bright,underscore"
609614

610615
# Test style with variables
611616
session.set_option("status-style", "fg=#{?pane_in_mode,red,green}")

0 commit comments

Comments
 (0)