tmuxtest.ScriptedTmux
Go
- Python Unavailable
- Ruby Unavailable
- Lua Unavailable
- TypeScript Unavailable
- Rust Unavailable
- Go
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- Module
- tmuxtest
- Package
- github.com/libtmux/libtmux-go/tmux
- Source
- tmux/tmuxtest/scripted.go
- ScriptedTmux ( t : testing.TB , script : ScriptedCommand ) string
-
ScriptedTmux writes an executable that answers tmux invocations from script and returns its absolute path, for
tmux.ServerOptions.Binary. It is how a test drives code that uses this package without a tmux to drive:server, err := tmux.NewServer(tmux.ServerOptions{ Binary: tmuxtest.ScriptedTmux(t, tmuxtest.ScriptedCommand{Contains: []string{"-V"}, Stdout: "tmux 3.7\n"}, tmuxtest.ScriptedCommand{ Contains: []string{"kill-pane"}, Stderr: "can't find pane: %7\n", ExitCode: 1, }, ), })
The executable is removed with the test. It answers commands only: opening a control connection or a notification stream speaks tmux's control protocol, which a script cannot, so code that opens one needs
NewServerand a real tmux.
0 declared, 0 inherited