Commit 604fa25
committed
fix: Correct async doctest examples for proper tmux isolation
Fixed two failing doctests in README.md (and docs/index.md which includes it):
1. **Test [20]**: Added `-s` flag to `list-panes` command
- Problem: Without `-s`, tmux treats session ID as window target
- Result: Only counted panes in current window instead of all session panes
- Fix: `session.acmd('list-panes', '-s')` to list all panes in session
2. **Test [21]**: Changed to use `server.acmd()` instead of `tmux_cmd_async()`
- Problem: `tmux_cmd_async()` without socket queried default tmux server
- Result: Non-deterministic counts based on developer's actual tmux state
- Fix: Use `server.acmd()` to maintain test isolation with unique socket
- Also: Changed to test behavior (returncode == 0) not specific counts
Root cause analysis:
- Both issues were incorrect API usage, not test infrastructure problems
- Missing `-s` flag violated tmux command semantics
- Missing socket specification broke test isolation
- Fixes maintain TestServer isolation pattern used throughout codebase
Test results:
- Before: 4 failed, 621 passed (with reruns)
- After: 0 failed, 625 passed, 7 skipped
These examples now correctly demonstrate async patterns while maintaining
proper test isolation and deterministic output.1 parent 22b1a0f commit 604fa25
1 file changed
+9
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | | - | |
| 305 | + | |
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
317 | 316 | | |
318 | 317 | | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
323 | 322 | | |
324 | | - | |
| 323 | + | |
| 324 | + | |
325 | 325 | | |
326 | | - | |
| 326 | + | |
| 327 | + | |
327 | 328 | | |
328 | 329 | | |
329 | 330 | | |
| |||
0 commit comments