@@ -452,3 +452,56 @@ def test_show_option_pane_fixture(
452
452
assert k in result
453
453
454
454
assert result [k ] == v
455
+
456
+
457
+ def test_stable_baseline_options_and_hooks (server : "Server" ) -> None :
458
+ """Ensure stable baseline across tmux versions."""
459
+ session = server .new_session (session_name = "test" , detach = True )
460
+
461
+ # List variables
462
+ assert server .show_option ("command-alias" ) == {
463
+ "choose-session" : "choose-tree -s" ,
464
+ "choose-window" : "choose-tree -w" ,
465
+ "info" : "show-messages -JT" ,
466
+ "server-info" : "show-messages -JT" ,
467
+ "split-pane" : "split-window" ,
468
+ "splitp" : "split-window" ,
469
+ }
470
+ if has_gte_version ("3.2" ):
471
+ assert server .show_option ("terminal-features" ) == {
472
+ "screen*" : [
473
+ "title" ,
474
+ ],
475
+ "xterm*" : [
476
+ "clipboard" ,
477
+ "ccolour" ,
478
+ "cstyle" ,
479
+ "focus" ,
480
+ "title" ,
481
+ ],
482
+ }
483
+ assert server .show_option ("terminal-overrides" ) is None
484
+ assert server .show_option ("user-keys" ) is None
485
+ assert server .show_option ("status-format" ) is None
486
+ assert server .show_option ("update-environment" ) is None
487
+
488
+ # List variables: Pane
489
+ pane = session .active_pane
490
+ assert pane is not None
491
+ assert pane .show_option ("pane-colours" ) is None
492
+
493
+
494
+ def test_high_level_api_expectations (server : "Server" ) -> None :
495
+ """Ensure options and hooks behave as expected."""
496
+
497
+ # Raw input and output
498
+ # Should be able to functionally parse raw CLI output, even outside of libtmux into
499
+ # options.
500
+
501
+ # Parsing steps
502
+ # 1. Basic KV split: Should split options into key,values.
503
+ # 2. Structure: Should decompose array-like options and dictionaries
504
+ # In the case of sparse arrays, which don't exist in Python, a SparseArray is
505
+ # used that behaves like a list but allows for sparse indexes so the indices
506
+ # aren't lost but the shape is still respected.
507
+ # 3. Python Typings: Should cast the fully structured objects into types
0 commit comments