This guide covers testing TUIOS, including running the test suite, writing new tests, and performing manual testing.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Gaurav-Gosain/tuios/llms.txt
Use this file to discover all available pages before exploring further.
Running Tests
Run All Tests
Run the complete test suite:Run Tests in Specific Package
Test a specific package:Verbose Output
See detailed test output:Run Specific Test
Run a single test by name:Short Mode
Skip slow tests:Race Detection
Detect race conditions in concurrent code:Run Specific Package with Race Detection
-race when testing concurrent code (PTY handling, goroutines, channels).
Benchmarks
Run Benchmarks
Run performance benchmarks:Benchmark Specific Package
Benchmark with Memory Stats
See memory allocations:Run Specific Benchmark
Compare Benchmarks
Compare performance before and after changes:Test Coverage
Generate Coverage Report
Detailed Coverage
Generate HTML coverage report:Coverage for Specific Package
Writing Tests
Test File Structure
Place test files alongside the code they test:_test.go suffix.
Table-Driven Tests
Use table-driven tests for multiple test cases:Subtests
Uset.Run() for subtests:
Test Helpers
Create helper functions for common setup:Example Tests
Write example tests that appear in godoc:Tape Script Testing
TUIOS includes tape scripting for automated testing.Validate Tape Files
Check tape syntax:Run Tape Scripts
Execute tape scripts:List Available Tapes
Create Test Tapes
Write.tape files for automated testing:
examples/ or testdata/ directories.
Manual Testing Checklist
When making changes to TUIOS, test these core features:Window Management
- Create new window (Ctrl+B c or n)
- Close window (Ctrl+B x)
- Switch between windows (Ctrl+B arrow keys)
- Rename window (Ctrl+B t r)
- Focus window by clicking
- Drag window with mouse
- Resize window with mouse
Workspaces
- Switch workspace (Alt+1 through Alt+9)
- Move window to workspace (Ctrl+B w then workspace number)
- Create windows in different workspaces
- Workspace indicator shows current workspace
Tiling Mode
- Toggle tiling (t key in window management mode)
- Windows tile automatically
- Create horizontal split (Ctrl+B -)
- Create vertical split (Ctrl+B |)
- Rotate split direction (Ctrl+B t r)
- Equalize splits (Ctrl+B t e)
- BSP preselection (Ctrl+B p + direction)
Copy Mode
- Enter copy mode (Ctrl+B [)
- Navigate with vim keys (h j k l)
- Scroll with Ctrl+D / Ctrl+U
- Search with / and n/N
- Select text with v
- Exit copy mode (q or Esc)
Terminal Functionality
- Text output displays correctly
- ANSI colors render properly
- Unicode characters work
- Scrollback buffer works (10,000 lines)
- Shell commands execute
- Terminal resizing works
Daemon Mode
- Create session (tuios new session1)
- List sessions (tuios ls)
- Attach to session (tuios attach session1)
- Detach from session (Ctrl+B d)
- Kill session (tuios kill-session session1)
- State persists across detach/attach
SSH Server Mode
- Start SSH server (tuios ssh)
- Connect from client (ssh -p 2222 localhost)
- Per-connection isolation works
- Multiple clients can connect
- Clean disconnect
Tape Recording
- Start recording (Ctrl+B T r)
- Perform actions
- Stop recording (Ctrl+B T s)
- Recording saves to file
- Playback works (tuios tape play filename)
Configuration
- Edit config (tuios config edit)
- Custom keybindings work
- Config reload without restart
- Invalid config shows error
Performance
- Create 10+ windows - smooth rendering
- Switch workspaces - no lag
- Fast output (cat large file) - stays responsive
- Memory usage stays reasonable
- No memory leaks over time
Cross-Platform (if applicable)
- Linux - works correctly
- macOS - works correctly
- Windows - works correctly (WSL or native)
- FreeBSD - works correctly
Debugging Tests
Print Debug Info
Add debug output:-v flag.
Skip Tests
Temporarily skip a test:Test Timeout
Set test timeout:Parallel Tests
Run tests in parallel:Continuous Integration
TUIOS uses GitHub Actions for CI:CI Runs
- All tests (
go test ./...) - Race detection (
go test -race ./...) - Linting (
golangci-lint) - Build verification
Test Locally Like CI
Run the same checks CI runs:Next Steps
- Contributing Guide - Submit your changes
- Building from Source - Build TUIOS locally
- Architecture Guide - Understand the codebase