https://github.com/fd0/termtest
Test terminal Go applications using tmux
https://github.com/fd0/termtest
Last synced: about 1 year ago
JSON representation
Test terminal Go applications using tmux
- Host: GitHub
- URL: https://github.com/fd0/termtest
- Owner: fd0
- Created: 2017-02-01T19:19:40.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-04-27T13:17:46.000Z (about 8 years ago)
- Last Synced: 2025-01-26T02:52:09.500Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](http://godoc.org/github.com/fd0/termtest)
[](https://travis-ci.org/fd0/termtest)
termtest is a small helper program to run terminal user interface tests by
using tmux in Go.
Example:
```go
// create terminal
term, _ := termtest.New()
// run a command in a terminal with 12 columns and 13 lines
buf, _ := term.Run(12, 13, "echo This is a long line that will wrap for sure")
// print the output string:
// Output: "This is a lo\nng line that\n will wrap f\nor sure\n\n\n\n\n\n\n\n\n\n"
fmt.Printf("%q\n", buf)
// stop the tmux instance
term.Exit()
```